@Override protected void augmentIdTableDefinition(Table idTable) { Column sessionIdColumn = new Column( Helper.SESSION_ID_COLUMN_NAME ); sessionIdColumn.setSqlType( "CHAR(36)" ); sessionIdColumn.setComment( "Used to hold the Hibernate Session identifier" ); idTable.addColumn( sessionIdColumn ); }
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(); } }
while( itr.hasNext() ) { Column column = (Column) itr.next(); idTable.addColumn( column.clone() );
LongType.INSTANCE ); table.addColumn( valueColumn );
table.addColumn( column ); sourceDocument.getMetadataCollector().addColumnNameBinding( table,
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(); } }
try { realm = Realm.getInstance(context, "database.realm"); Log.i("Database2", context.getFilesDir().getPath()); } catch (RealmMigrationNeededException ex) { Realm.migrateRealmAtPath(context.getFileStreamPath("database.realm").getPath(), new RealmMigration() { @Override public long execute(Realm realm, long version) { Log.i("Database", "Yay!"); // Migrate stuff... Table table = realm.getTable(RealmTestObjectTwo.class); table.addColumn(ColumnType.INTEGER, "key"); table.addColumn(ColumnType.STRING, "value"); table.setPrimaryKey("key"); version += 1; // End Migrate Stuff... return version; } }); }
public void prepareTemporaryTables(Mapping mapping, Dialect dialect) { if ( dialect.supportsTemporaryTables() ) { temporaryIdTableName = dialect.generateTemporaryTableName( getTable().getName() ); Table table = new Table(); table.setName( temporaryIdTableName ); Iterator itr = getTable().getPrimaryKey().getColumnIterator(); while( itr.hasNext() ) { Column column = (Column) itr.next(); table.addColumn( (Column) column.clone() ); } temporaryIdTableDDL = table.sqlTemporaryTableCreateString( dialect, mapping ); } }
public void prepareTemporaryTables(Mapping mapping, Dialect dialect) { if ( dialect.supportsTemporaryTables() ) { temporaryIdTableName = dialect.generateTemporaryTableName( getTable().getName() ); Table table = new Table(); table.setName( temporaryIdTableName ); Iterator itr = getTable().getPrimaryKey().getColumnIterator(); while( itr.hasNext() ) { Column column = (Column) itr.next(); table.addColumn( (Column) column.clone() ); } temporaryIdTableDDL = table.sqlTemporaryTableCreateString( dialect, mapping ); } }
public void prepareTemporaryTables(Mapping mapping, Dialect dialect) { if ( dialect.supportsTemporaryTables() ) { temporaryIdTableName = dialect.generateTemporaryTableName( getTable().getName() ); Table table = new Table(); table.setName( temporaryIdTableName ); Iterator itr = getTable().getPrimaryKey().getColumnIterator(); while( itr.hasNext() ) { Column column = (Column) itr.next(); table.addColumn( (Column) column.clone() ); } temporaryIdTableDDL = table.sqlTemporaryTableCreateString( dialect, mapping ); } }
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 void linkValueUsingAColumnCopy(PersistentProperty prop, Column column, DependantValue key) { Column mappingColumn = new Column(); mappingColumn.setName(column.getName()); mappingColumn.setLength(column.getLength()); mappingColumn.setNullable(prop.isNullable()); mappingColumn.setSqlType(column.getSqlType()); mappingColumn.setValue(key); key.addColumn(mappingColumn); key.getTable().addColumn(mappingColumn); }
private static void linkValueUsingAColumnCopy(GrailsDomainClassProperty prop, Column column, DependantValue key) { Column mappingColumn = new Column(); mappingColumn.setName(column.getName()); mappingColumn.setLength(column.getLength()); mappingColumn.setNullable(prop.isOptional()); mappingColumn.setSqlType(column.getSqlType()); mappingColumn.setValue(key); key.addColumn(mappingColumn); key.getTable().addColumn(mappingColumn); }