/** * The database-specific SQL type of this column. * @deprecated */ public void setTypeName(String typeName) { setTypeIdentifier(DBIdentifier.newColumnDefinition(typeName)); }
/** * The database-specific SQL type of this column. * @deprecated */ public void setTypeName(String typeName) { setTypeIdentifier(DBIdentifier.newColumnDefinition(typeName)); }
/** * The database-specific SQL type of this column. * @deprecated */ public void setTypeName(String typeName) { setTypeIdentifier(DBIdentifier.newColumnDefinition(typeName)); }
/** * The database-specific SQL type of this column. * @deprecated */ public void setTypeName(String typeName) { setTypeIdentifier(DBIdentifier.newColumnDefinition(typeName)); }
private boolean startDatastoreIdCol(Attributes attrs) throws SAXException { ClassMapping cm = (ClassMapping) peekElement(); Column col = new Column(); String name = attrs.getValue("name"); if (!StringUtil.isEmpty(name)); col.setIdentifier(DBIdentifier.newColumn(name, delimit())); String columnDefinition= attrs.getValue("column-definition"); if (!StringUtil.isEmpty(columnDefinition)) col.setTypeIdentifier(DBIdentifier.newColumnDefinition(columnDefinition)); int precision = Integer.parseInt(attrs.getValue("precision")); if (precision != 0) col.setSize(precision); col.setFlag(Column.FLAG_UNINSERTABLE, !Boolean.parseBoolean(attrs.getValue("insertable"))); col.setFlag(Column.FLAG_UNUPDATABLE, !Boolean.parseBoolean(attrs.getValue("updatable"))); cm.getMappingInfo().setColumns(Arrays.asList(new Column[]{ col })); return true; }
/** * Create a new schema column with information from the given annotation. */ private Column newColumn(PrimaryKeyJoinColumn join) { Column col = new Column(); col.setFlag(Column.FLAG_PK_JOIN, true); if (!StringUtils.isEmpty(join.name())) col.setIdentifier(DBIdentifier.newColumn(join.name(), delimit())); if (!StringUtils.isEmpty(join.columnDefinition())) col.setTypeIdentifier(DBIdentifier.newColumnDefinition(join.columnDefinition())); if (!StringUtils.isEmpty(join.referencedColumnName())) setTargetIdentifier(col, join.referencedColumnName()); return col; }
public boolean isCompatible(int type, String typeName, int size, int decimals) { if (getType() != Types.OTHER) return super.isCompatible(type, typeName, size, decimals); if (type == Types.VARCHAR && size <= 0) size = _dict.characterColumnSize; setType(type); setSize(size); if (typeName != null) setTypeIdentifier(DBIdentifier.newColumnDefinition(typeName)); if (decimals >= 0) setDecimalDigits(decimals); return true; } }
public boolean isCompatible(int type, String typeName, int size, int decimals) { if (getType() != Types.OTHER) return super.isCompatible(type, typeName, size, decimals); if (type == Types.VARCHAR && size <= 0) size = _dict.characterColumnSize; setType(type); setSize(size); if (typeName != null) setTypeIdentifier(DBIdentifier.newColumnDefinition(typeName)); if (decimals >= 0) setDecimalDigits(decimals); return true; } }
public boolean isCompatible(int type, String typeName, int size, int decimals) { if (getType() != Types.OTHER) return super.isCompatible(type, typeName, size, decimals); if (type == Types.VARCHAR && size <= 0) size = _dict.characterColumnSize; setType(type); setSize(size); if (typeName != null) setTypeIdentifier(DBIdentifier.newColumnDefinition(typeName)); if (decimals >= 0) setDecimalDigits(decimals); return true; } }
public boolean isCompatible(int type, String typeName, int size, int decimals) { if (getType() != Types.OTHER) return super.isCompatible(type, typeName, size, decimals); if (type == Types.VARCHAR && size <= 0) size = _dict.characterColumnSize; setType(type); setSize(size); if (typeName != null) setTypeIdentifier(DBIdentifier.newColumnDefinition(typeName)); if (decimals >= 0) setDecimalDigits(decimals); return true; } }
public Column[] map(ValueMapping vm, DBIdentifier name, ColumnIO io, boolean adapt) { Column col = new Column(); col.setIdentifier(name); col.setJavaType(JavaTypes.STRING); col.setSize(-1); col.setTypeIdentifier(DBIdentifier.newColumnDefinition(vm.getMappingRepository().getDBDictionary() .xmlTypeName)); col.setXML(true); return new Column[]{ col }; }
public Column[] map(ValueMapping vm, DBIdentifier name, ColumnIO io, boolean adapt) { Column col = new Column(); col.setIdentifier(name); col.setJavaType(JavaTypes.STRING); col.setSize(-1); col.setTypeIdentifier(DBIdentifier.newColumnDefinition(vm.getMappingRepository().getDBDictionary() .xmlTypeName)); col.setXML(true); return new Column[]{ col }; }
public Column[] map(ValueMapping vm, DBIdentifier name, ColumnIO io, boolean adapt) { Column col = new Column(); col.setIdentifier(name); col.setJavaType(JavaTypes.STRING); col.setSize(-1); col.setTypeIdentifier(DBIdentifier.newColumnDefinition(vm.getMappingRepository().getDBDictionary() .xmlTypeName)); col.setXML(true); return new Column[]{ col }; }
public Column[] map(ValueMapping vm, DBIdentifier name, ColumnIO io, boolean adapt) { Column col = new Column(); col.setIdentifier(name); col.setJavaType(JavaTypes.STRING); col.setSize(-1); col.setTypeIdentifier(DBIdentifier.newColumnDefinition(vm.getMappingRepository().getDBDictionary() .xmlTypeName)); col.setXML(true); return new Column[]{ col }; }
/** * Create a new schema column with information from the given annotation. */ private Column newColumn(JoinColumn join) { Column col = new Column(); if (!StringUtils.isEmpty(join.name())) col.setIdentifier(DBIdentifier.newColumn(join.name(), delimit())); if (!StringUtils.isEmpty(join.columnDefinition())) col.setTypeIdentifier(DBIdentifier.newColumnDefinition(join.columnDefinition())); String refColumnName = join.referencedColumnName(); if (!StringUtils.isEmpty(refColumnName)) { setTargetIdentifier(col, refColumnName); } col.setNotNull(!join.nullable()); col.setFlag(Column.FLAG_UNINSERTABLE, !join.insertable()); col.setFlag(Column.FLAG_UNUPDATABLE, !join.updatable()); return col; }
/** * Create a new schema column with information from the given annotation. */ private static Column newColumn(KeyJoinColumn join, boolean delimit) { Column col = new Column(); if (!StringUtils.isEmpty(join.name())) col.setIdentifier(DBIdentifier.newColumn(join.name(),delimit)); if (!StringUtils.isEmpty(join.columnDefinition())) col.setIdentifier(DBIdentifier.newColumnDefinition(join.columnDefinition())); if (!StringUtils.isEmpty(join.referencedColumnName())) col.setTargetIdentifier(DBIdentifier.newColumn(join.referencedColumnName(),delimit)); if (!StringUtils.isEmpty(join.referencedAttributeName())) col.setTargetField(join.referencedAttributeName()); col.setNotNull(!join.nullable()); col.setFlag(Column.FLAG_UNINSERTABLE, !join.insertable()); col.setFlag(Column.FLAG_UNUPDATABLE, !join.updatable ()); return col; }
/** * Parse datastore identity information in @DataStoreIdColumn. */ private void parseDataStoreIdColumn(ClassMapping cm, DataStoreIdColumn id) { Column col = new Column(); if (!StringUtil.isEmpty(id.name())) col.setIdentifier(DBIdentifier.newColumn(id.name(), delimit())); if (!StringUtil.isEmpty(id.columnDefinition())) col.setTypeIdentifier(DBIdentifier.newColumnDefinition(id.columnDefinition())); if (id.precision() != 0) col.setSize(id.precision()); col.setFlag(Column.FLAG_UNINSERTABLE, !id.insertable()); col.setFlag(Column.FLAG_UNUPDATABLE, !id.updatable()); cm.getMappingInfo().setColumns(Arrays.asList(new Column[]{ col })); }
/** * Create a new schema column with information from the given annotation. */ private Column newColumn(PrimaryKeyJoinColumn join) { Column col = new Column(); col.setFlag(Column.FLAG_PK_JOIN, true); if (!StringUtil.isEmpty(join.name())) col.setIdentifier(DBIdentifier.newColumn(join.name(), delimit())); if (!StringUtil.isEmpty(join.columnDefinition())) col.setTypeIdentifier(DBIdentifier.newColumnDefinition(join.columnDefinition())); if (!StringUtil.isEmpty(join.referencedColumnName())) setTargetIdentifier(col, join.referencedColumnName()); return col; }
/** * Create a new schema column with information from the given annotation. */ private Column newColumn(PrimaryKeyJoinColumn join) { Column col = new Column(); col.setFlag(Column.FLAG_PK_JOIN, true); if (!StringUtil.isEmpty(join.name())) col.setIdentifier(DBIdentifier.newColumn(join.name(), delimit())); if (!StringUtil.isEmpty(join.columnDefinition())) col.setTypeIdentifier(DBIdentifier.newColumnDefinition(join.columnDefinition())); if (!StringUtil.isEmpty(join.referencedColumnName())) setTargetIdentifier(col, join.referencedColumnName()); return col; }
/** * Parse @javax.persistence.OrderColumn */ private void parseJavaxOrderColumn(FieldMapping fm, javax.persistence.OrderColumn order) { Column col = new Column(); if (!StringUtil.isEmpty(order.name())) col.setIdentifier(DBIdentifier.newColumn(order.name(), delimit())); if (!StringUtil.isEmpty(order.columnDefinition())) col.setTypeIdentifier(DBIdentifier.newColumnDefinition(order.columnDefinition())); col.setNotNull(!order.nullable()); col.setFlag(Column.FLAG_UNINSERTABLE, !order.insertable()); col.setFlag(Column.FLAG_UNUPDATABLE, !order.updatable()); fm.getMappingInfo().setOrderColumn(col); }