public void addColumn(Column column) { addColumn( column, true, true ); }
public void linkWithValue(SimpleValue value) { if ( formula != null ) { value.addFormula( formula ); } else { getMappingColumn().setValue( value ); value.addColumn( getMappingColumn(), insertable, updatable ); value.getTable().addColumn( getMappingColumn() ); addColumnBinding( value ); table = value.getTable(); } }
value.addColumn( new Column( columnName ) ); if ( joinColumn != null ) { applyComponentColumnSizeValueToJoinColumn( column, joinColumn );
copy.setComment( column.getComment() ); copy.setDefaultValue( column.getDefaultValue() ); key.addColumn( copy );
column.setCustomWrite( columnSource.getWriteFragment() ); simpleValue.addColumn( column );
public void linkWithValue(SimpleValue value) { if ( formula != null ) { value.addFormula( formula ); } else { getMappingColumn().setValue( value ); value.addColumn( getMappingColumn() ); value.getTable().addColumn( getMappingColumn() ); addColumnBinding( value ); table = value.getTable(); } }
value.addColumn( new Column( columnName ) ); column.setValue( value );
public void linkWithValue(SimpleValue value) { if ( formula != null ) { value.addFormula( formula ); } else { value.addColumn( getMappingColumn() ); } }
copy.setComment( column.getComment() ); copy.setDefaultValue( column.getDefaultValue() ); key.addColumn( copy );
@Override public void addColumn(Column column) { if ( getMappedColumns().size() > 0 && !getMappedColumn().equals( column ) ) { throw new MappingException( "Attempt to add additional MappedColumn to BasicValueMapping " + column.getName() ); } super.addColumn( column ); }
private SimpleValue bindColumnToSimpleValue(Table table, Column column, Mapping mapping, boolean generatedIdentifier) { SimpleValue value = new SimpleValue(mdbc, table); value.addColumn(column); value.setTypeName(guessAndAlignType(table, column, mapping, generatedIdentifier)); return value; }
private SimpleValue bindColumnToSimpleValue(Table table, Column column, Mapping mapping, boolean generatedIdentifier) { SimpleValue value = new SimpleValue((MetadataImplementor)metadata, table); value.addColumn(column); value.setTypeName(guessAndAlignType(table, column, mapping, generatedIdentifier)); return value; }
public void linkWithValue(SimpleValue value) { if ( formula != null ) { value.addFormula( formula ); } else { getMappingColumn().setValue( value ); value.addColumn( getMappingColumn() ); value.getTable().addColumn( getMappingColumn() ); addColumnBinding( value ); table = value.getTable(); } }
public void linkWithValue(SimpleValue value) { if ( formula != null ) { value.addFormula( formula ); } else { getMappingColumn().setValue( value ); value.addColumn( getMappingColumn() ); value.getTable().addColumn( getMappingColumn() ); addColumnBinding( value ); table = value.getTable(); } }
public void linkWithValue(SimpleValue value) { if ( formula != null ) { value.addFormula( formula ); } else { getMappingColumn().setValue( value ); value.addColumn( getMappingColumn() ); value.getTable().addColumn( getMappingColumn() ); addColumnBinding( value ); table = value.getTable(); } }
/** * Binds a value for the specified parameters to the meta model. * * @param type The type of the property * @param simpleValue The simple value instance * @param nullable Whether it is nullable * @param columnName The property name * @param mappings The mappings */ protected void bindSimpleValue(String type, SimpleValue simpleValue, boolean nullable, String columnName, Mappings mappings) { simpleValue.setTypeName(type); Table t = simpleValue.getTable(); Column column = new Column(); column.setNullable(nullable); column.setValue(simpleValue); column.setName(columnName); if (t != null) t.addColumn(column); simpleValue.addColumn(column); }
/** * Binds a value for the specified parameters to the meta model. * * @param type The type of the property * @param simpleValue The simple value instance * @param nullable Whether it is nullable * @param columnName The property name * @param mappings The mappings */ private static void bindSimpleValue(String type, SimpleValue simpleValue, boolean nullable, String columnName, @SuppressWarnings("unused") Mappings mappings) { simpleValue.setTypeName(type); Table t = simpleValue.getTable(); Column column = new Column(); column.setNullable(nullable); column.setValue(simpleValue); column.setName(columnName); if (t != null) t.addColumn(column); simpleValue.addColumn(column); }
protected Column createColumn(Mappings mappings, Table tab, com.manydesigns.portofino.model.database.Column column) { Column col = new Column(); col.setName(quoteIdentifier(column.getColumnName())); if(column.getLength() != null) { col.setLength(column.getLength()); col.setPrecision(column.getLength()); } if(column.getScale() != null) { col.setScale(column.getScale()); } col.setNullable(column.isNullable()); String columnType = column.getColumnType(); int jdbcType = column.getJdbcType(); col.setSqlTypeCode(jdbcType); col.setSqlType(columnType); SimpleValue value = new SimpleValue(mappings, tab); if (!setHibernateType(value, column)) { logger.error("Skipping column {}", column.getQualifiedName()); return null; } value.addColumn(col); tab.addColumn(col); mappings.addColumnBinding(column.getColumnName(), col, tab); return col; }
protected Column createColumn(Mappings mappings, Table tab, com.manydesigns.portofino.model.database.Column column) { Column col = new Column(); col.setName(quoteIdentifier(column.getColumnName())); if(column.getLength() != null) { col.setLength(column.getLength()); col.setPrecision(column.getLength()); } if(column.getScale() != null) { col.setScale(column.getScale()); } col.setNullable(column.isNullable()); String columnType = column.getColumnType(); int jdbcType = column.getJdbcType(); col.setSqlTypeCode(jdbcType); col.setSqlType(columnType); SimpleValue value = new SimpleValue(mappings, tab); if (!setHibernateType(value, column)) { logger.error("Skipping column {}", column.getQualifiedName()); return null; } value.addColumn(col); tab.addColumn(col); mappings.addColumnBinding(column.getColumnName(), col, tab); return col; }
@Override protected void afterMetadataBuilt(Metadata metadata) { if (addVersions) { for (PersistentClass clazz : metadata.getEntityBindings()) { if (clazz.getVersion() != null) { continue; } try { clazz.getMappedClass().getMethod("getVersion"); clazz.getMappedClass().getMethod("setVersion", long.class); } catch (NoSuchMethodException e) { continue; } RootClass rootClazz = clazz.getRootClass(); Property versionProperty = new Property(); versionProperty.setName("version"); SimpleValue value = new SimpleValue((MetadataImplementor) metadata, rootClazz.getTable()); value.setTypeName("long"); Column column = new Column(); column.setValue(value); column.setName("version"); value.addColumn(column); rootClazz.getTable().addColumn(column); versionProperty.setValue(value); rootClazz.setVersion(versionProperty); rootClazz.addProperty(versionProperty); } } }