IDEMPIERE-4045 Allow to create model from view (FHCA-1057)
This commit is contained in:
parent
7d0101fcee
commit
c2a1aea45c
|
@ -895,20 +895,24 @@ public class ModelClassGenerator
|
|||
file.mkdirs();
|
||||
|
||||
// complete sql
|
||||
String filterViews = null;
|
||||
if (tableLike.toString().contains("%")) {
|
||||
filterViews = "AND (TableName IN ('RV_WarehousePrice','RV_BPartner') OR IsView='N')"; // special views
|
||||
}
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT AD_Table_ID ")
|
||||
.append("FROM AD_Table ")
|
||||
.append("WHERE (TableName IN ('RV_WarehousePrice','RV_BPartner')") // special views
|
||||
.append(" OR IsView='N')")
|
||||
.append(" AND IsActive = 'Y' AND TableName NOT LIKE '%_Trl' ");
|
||||
.append("WHERE IsActive = 'Y' AND TableName NOT LIKE '%_Trl' ");
|
||||
// Autodetect if we need to use IN or LIKE clause - teo_sarca [ 3020640 ]
|
||||
if (tableLike.indexOf(",") == -1)
|
||||
sql.append(" AND TableName LIKE ").append(tableLike);
|
||||
else
|
||||
sql.append(" AND TableName IN (").append(tableLike).append(")"); // only specific tables
|
||||
sql.append(" AND ").append(entityTypeFilter.toString());
|
||||
if (filterViews != null) {
|
||||
sql.append(filterViews);
|
||||
}
|
||||
sql.append(" ORDER BY TableName");
|
||||
|
||||
//
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
|
|
|
@ -813,18 +813,23 @@ public class ModelInterfaceGenerator
|
|||
file.mkdirs();
|
||||
|
||||
// complete sql
|
||||
String filterViews = null;
|
||||
if (tableLike.toString().contains("%")) {
|
||||
filterViews = "AND (TableName IN ('RV_WarehousePrice','RV_BPartner') OR IsView='N')"; // special views
|
||||
}
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT AD_Table_ID ")
|
||||
.append("FROM AD_Table ")
|
||||
.append("WHERE (TableName IN ('RV_WarehousePrice','RV_BPartner')") // special views
|
||||
.append(" OR IsView='N')")
|
||||
.append(" AND IsActive = 'Y' AND TableName NOT LIKE '%_Trl' ");
|
||||
.append("WHERE IsActive = 'Y' AND TableName NOT LIKE '%_Trl' ");
|
||||
// Autodetect if we need to use IN or LIKE clause - teo_sarca [ 3020640 ]
|
||||
if (tableLike.indexOf(",") == -1)
|
||||
sql.append(" AND TableName LIKE ").append(tableLike);
|
||||
else
|
||||
sql.append(" AND TableName IN (").append(tableLike).append(")"); // only specific tables
|
||||
sql.append(" AND ").append(entityTypeFilter.toString());
|
||||
if (filterViews != null) {
|
||||
sql.append(filterViews);
|
||||
}
|
||||
sql.append(" ORDER BY TableName");
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue