Failure to generate getI* shouldn't be fatal. Also, the current algorithm use to discover the reference tablename is by no mean fool proof.

This commit is contained in:
Heng Sin Low 2008-12-03 09:51:08 +00:00
parent 6b33b0ab59
commit 4022504df5
2 changed files with 60 additions and 57 deletions

View File

@ -397,8 +397,8 @@ public class ModelClassGenerator
String referenceClassName = "I_"+columnName.substring(0, columnName.length()-3);
MTable table = MTable.get(Env.getCtx(), tableName);
if (table == null)
throw new RuntimeException("No table found for "+tableName);
if (table != null)
{
String entityType = table.getEntityType();
if (!"D".equals(entityType))
{
@ -439,6 +439,7 @@ public class ModelClassGenerator
.append(" return result;").append(NL)
.append(" }").append(NL)
;
}
// Add imports:
addImportClass(java.lang.reflect.Constructor.class);
addImportClass(java.util.logging.Level.class);

View File

@ -360,6 +360,7 @@ public class ModelInterfaceGenerator
String tableName = columnName.substring(0, columnName.length()-3);
MTable table = MTable.get(Env.getCtx(), tableName);
if (table != null) {
String entityType = table.getEntityType();
if (!"D".equals(entityType))
{
@ -381,6 +382,7 @@ public class ModelInterfaceGenerator
sb.append("\n")
.append("\tpublic "+referenceClassName+" get").append(tableName).append("() throws RuntimeException;")
;
}
} else {
// TODO - Handle other types
//sb.append("\tpublic I_"+columnName+" getI_").append(columnName).append("(){return null; };");