IDEMPIERE-2513 Sequence Check not working for native sequences

This commit is contained in:
Carlos Ruiz 2015-03-11 11:11:23 -05:00
parent d9098bd571
commit 9716fac80c
2 changed files with 6 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import java.sql.ResultSet;
import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.Adempiere;
import org.compiere.model.MClient;
import org.compiere.model.MSequence;
@ -79,6 +80,7 @@ public class SequenceCheck extends SvrProcess
catch (Exception e)
{
s_log.log(Level.SEVERE, "validate", e);
throw new AdempiereException(e);
}
} // validate
@ -124,6 +126,7 @@ public class SequenceCheck extends SvrProcess
catch (Exception e)
{
s_log.log(Level.SEVERE, sql, e);
throw new AdempiereException(e);
}
finally
{
@ -173,6 +176,7 @@ public class SequenceCheck extends SvrProcess
catch (Exception e)
{
s_log.log (Level.SEVERE, sql, e);
throw new AdempiereException(e);
}
finally
{
@ -233,6 +237,7 @@ public class SequenceCheck extends SvrProcess
catch (Exception e)
{
s_log.log(Level.SEVERE, sql, e);
throw new AdempiereException(e);
}
finally
{

View File

@ -902,6 +902,7 @@ public class MSequence extends X_AD_Sequence
+ "FROM AD_Table t"
+ " INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID) "
+ "WHERE t.TableName='" + tableName + "'"
+ " AND t.IsView='N'" // ignore for views -- IDEMPIERE-2513
+ " AND c.ColumnName='" + tableName + "_ID'");
if (AD_Column_ID <= 0)
return null;