/** * Return the DB column type definition. */ public String renderDbType(DbType dbType) { if (dbColumnDefn != null) { return dbColumnDefn; } return dbType.renderType(dbLength, dbScale); }
/** * Return the DB column type definition. */ public String renderDbType(DbType dbType) { if (dbColumnDefn != null) { return dbColumnDefn; } return dbType.renderType(dbLength, dbScale); }
public boolean visitBean(BeanDescriptor<?> descriptor) { wroteColumns.clear(); if (!descriptor.isInheritanceRoot()){ return false; } ctx.write("create table "); writeTableName(descriptor); ctx.write(" (").writeNewLine(); InheritInfo inheritInfo = descriptor.getInheritInfo(); if (inheritInfo != null && inheritInfo.isRoot()){ String discColumn = inheritInfo.getDiscriminatorColumn(); int discType = inheritInfo.getDiscriminatorType(); int discLength = inheritInfo.getDiscriminatorLength(); DbType dbType = ctx.getDbTypeMap().get(discType); String discDbType = dbType.renderType(discLength, 0); writeColumnName(discColumn, null); ctx.write(discDbType); ctx.write(" not null,"); ctx.writeNewLine(); } return true; }
public boolean visitBean(BeanDescriptor<?> descriptor) { wroteColumns.clear(); if (!descriptor.isInheritanceRoot()){ return false; } ctx.write("create table "); writeTableName(descriptor); ctx.write(" (").writeNewLine(); InheritInfo inheritInfo = descriptor.getInheritInfo(); if (inheritInfo != null && inheritInfo.isRoot()){ String discColumn = inheritInfo.getDiscriminatorColumn(); int discType = inheritInfo.getDiscriminatorType(); int discLength = inheritInfo.getDiscriminatorLength(); DbType dbType = ctx.getDbTypeMap().get(discType); String discDbType = dbType.renderType(discLength, 0); writeColumnName(discColumn, null); ctx.write(discDbType); ctx.write(" not null,"); ctx.writeNewLine(); } return true; }