diff --git a/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java index 0da54de921..026a04ac49 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java @@ -248,7 +248,6 @@ public class ModelClassGenerator .append(" public String toString()").append(NL) .append(" {").append(NL) .append(" StringBuilder sb = new StringBuilder (\"").append(className).append("[\")").append(NL) - // TODO: generate getName if there is a Name column -- .append(",Name=").append(getName()) .append(" .append(get_ID())"); if (hasName) start.append(".append(\",Name=\").append(getName())"); @@ -905,6 +904,9 @@ public class ModelClassGenerator if (tableLike.toString().contains("%")) { filterViews = "AND (TableName IN ('RV_WarehousePrice','RV_BPartner') OR IsView='N')"; // special views } + if (tableLike.toString().equals("'%'")) { + filterViews += " AND TableName NOT LIKE 'W|_%' ESCAPE '|'"; // exclude webstore from general model generator + } StringBuilder sql = new StringBuilder(); sql.append("SELECT AD_Table_ID ") .append("FROM AD_Table ") diff --git a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java index ad06da5b93..d75c2f91f2 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java @@ -775,9 +775,9 @@ public class ModelInterfaceGenerator if (tableName == null || tableName.trim().length() == 0) throw new IllegalArgumentException("Must specify table name"); - String tableLike = tableName.trim(); - if (!tableLike.startsWith("'") || !tableLike.endsWith("'")) - tableLike = "'" + tableLike + "'"; + StringBuilder tableLike = new StringBuilder().append(tableName.trim()); + if (!tableLike.toString().startsWith("'") || !tableLike.toString().endsWith("'")) + tableLike = new StringBuilder("'").append(tableLike).append("'"); StringBuilder entityTypeFilter = new StringBuilder(); if (entityType != null && entityType.trim().length() > 0) @@ -821,6 +821,9 @@ public class ModelInterfaceGenerator if (tableLike.toString().contains("%")) { filterViews = "AND (TableName IN ('RV_WarehousePrice','RV_BPartner') OR IsView='N')"; // special views } + if (tableLike.toString().equals("'%'")) { + filterViews += " AND TableName NOT LIKE 'W|_%' ESCAPE '|'"; // exclude webstore from general model generator + } StringBuilder sql = new StringBuilder(); sql.append("SELECT AD_Table_ID ") .append("FROM AD_Table ")