/** * Create a new schema column with information from the given annotation. */ private static Column newColumn(ElementColumn anno) { Column col = new Column(); if (!StringUtils.isEmpty(anno.name())) col.setName(anno.name()); if (!StringUtils.isEmpty(anno.columnDefinition())) col.setTypeName(anno.columnDefinition()); if (anno.precision() != 0) col.setSize(anno.precision()); else if (anno.length() != 255) col.setSize(anno.length()); col.setNotNull(!anno.nullable()); col.setDecimalDigits(anno.scale()); col.setFlag(Column.FLAG_UNINSERTABLE, !anno.insertable()); col.setFlag(Column.FLAG_UNUPDATABLE, !anno.updatable()); return col; }
/** * Create a new schema column with information from the given annotation. */ private static Column newColumn(ElementColumn anno, boolean delimit) { Column col = new Column(); if (!StringUtils.isEmpty(anno.name())) col.setIdentifier(DBIdentifier.newColumn(anno.name(), delimit)); if (!StringUtils.isEmpty(anno.columnDefinition())) col.setTypeIdentifier(DBIdentifier.newColumnDefinition(anno.columnDefinition())); if (anno.precision() != 0) col.setSize(anno.precision()); else if (anno.length() != 255) col.setSize(anno.length()); col.setNotNull(!anno.nullable()); col.setDecimalDigits(anno.scale()); col.setFlag(Column.FLAG_UNINSERTABLE, !anno.insertable()); col.setFlag(Column.FLAG_UNUPDATABLE, !anno.updatable()); return col; }
/** * Create a new schema column with information from the given annotation. */ private static Column newColumn(ElementColumn anno, boolean delimit) { Column col = new Column(); if (!StringUtil.isEmpty(anno.name())) col.setIdentifier(DBIdentifier.newColumn(anno.name(), delimit)); if (!StringUtil.isEmpty(anno.columnDefinition())) col.setTypeIdentifier(DBIdentifier.newColumnDefinition(anno.columnDefinition())); if (anno.precision() != 0) col.setSize(anno.precision()); else if (anno.length() != 255) col.setSize(anno.length()); col.setNotNull(!anno.nullable()); col.setDecimalDigits(anno.scale()); col.setFlag(Column.FLAG_UNINSERTABLE, !anno.insertable()); col.setFlag(Column.FLAG_UNUPDATABLE, !anno.updatable()); return col; }
/** * Create a new schema column with information from the given annotation. */ private static Column newColumn(ElementColumn anno, boolean delimit) { Column col = new Column(); if (!StringUtil.isEmpty(anno.name())) col.setIdentifier(DBIdentifier.newColumn(anno.name(), delimit)); if (!StringUtil.isEmpty(anno.columnDefinition())) col.setTypeIdentifier(DBIdentifier.newColumnDefinition(anno.columnDefinition())); if (anno.precision() != 0) col.setSize(anno.precision()); else if (anno.length() != 255) col.setSize(anno.length()); col.setNotNull(!anno.nullable()); col.setDecimalDigits(anno.scale()); col.setFlag(Column.FLAG_UNINSERTABLE, !anno.insertable()); col.setFlag(Column.FLAG_UNUPDATABLE, !anno.updatable()); return col; }