/** * Constructor. Supply owning mapping. */ public Version(ClassMapping mapping) { _mapping = mapping; _info = getMappingRepository().newMappingInfo(this); }
/** * Constructor. Supply owning mapping. */ public Version(ClassMapping mapping) { _mapping = mapping; _info = getMappingRepository().newMappingInfo(this); }
/** * Constructor. Supply owning mapping. */ public Version(ClassMapping mapping) { _mapping = mapping; _info = getMappingRepository().newMappingInfo(this); }
/** * Constructor. Supply owning mapping. */ public Version(ClassMapping mapping) { _mapping = mapping; _info = getMappingRepository().newMappingInfo(this); }
/** * Constructor. Supply owning mapping. */ public Version(ClassMapping mapping) { _mapping = mapping; _info = getMappingRepository().newMappingInfo(this); }
/** * Return the index to set on the version columns, or null if none. */ public Index getIndex(Version version, Column[] cols, boolean adapt) { Index idx = null; if (cols.length > 0) idx = version.getMappingRepository().getMappingDefaults(). getIndex(version, cols[0].getTable(), cols); return createIndex(version, null, idx, cols, adapt); }
/** * Return the index to set on the version columns, or null if none. */ public Index getIndex(Version version, Column[] cols, boolean adapt) { Index idx = null; if (cols.length > 0) idx = version.getMappingRepository().getMappingDefaults(). getIndex(version, cols[0].getTable(), cols); return createIndex(version, null, idx, cols, adapt); }
/** * Return the index to set on the version columns, or null if none. */ public Index getIndex(Version version, Column[] cols, boolean adapt) { Index idx = null; if (cols.length > 0) idx = version.getMappingRepository().getMappingDefaults(). getIndex(version, cols[0].getTable(), cols); return createIndex(version, null, idx, cols, adapt); }
/** * Return the index to set on the version columns, or null if none. */ public Index getIndex(Version version, Column[] cols, boolean adapt) { Index idx = null; if (cols.length > 0) idx = version.getMappingRepository().getMappingDefaults(). getIndex(version, cols[0].getTable(), cols); return createIndex(version, null, idx, cols, adapt); }
/** * Return the index to set on the version columns, or null if none. */ public Index getIndex(Version version, Column[] cols, boolean adapt) { Index idx = null; if (cols.length > 0) idx = version.getMappingRepository().getMappingDefaults(). getIndex(version, cols[0].getTable(), cols); return createIndex(version, null, idx, cols, adapt); }
/** * Return the columns set for this version, based on the given templates. */ public Column[] getColumns(Version version, Column[] tmplates, boolean adapt) { Table table = version.getClassMapping().getTable(); version.getMappingRepository().getMappingDefaults().populateColumns (version, table, tmplates); return createColumns(version, null, tmplates, table, adapt); }
/** * Return the columns set for this version, based on the given templates. */ public Column[] getColumns(Version version, Column[] templates, boolean adapt) { if (spansMultipleTables(templates)) return getMultiTableColumns(version, templates, adapt); Table table = getSingleTable(version, templates); version.getMappingRepository().getMappingDefaults().populateColumns (version, table, templates); return createColumns(version, null, templates, table, adapt); }
/** * Return the columns set for this version, based on the given templates. */ public Column[] getColumns(Version version, Column[] templates, boolean adapt) { if (spansMultipleTables(templates)) return getMultiTableColumns(version, templates, adapt); Table table = getSingleTable(version, templates); version.getMappingRepository().getMappingDefaults().populateColumns (version, table, templates); return createColumns(version, null, templates, table, adapt); }
/** * Return the columns set for this version, based on the given templates. */ public Column[] getColumns(Version version, Column[] templates, boolean adapt) { if (spansMultipleTables(templates)) return getMultiTableColumns(version, templates, adapt); Table table = getSingleTable(version, templates); version.getMappingRepository().getMappingDefaults().populateColumns (version, table, templates); return createColumns(version, null, templates, table, adapt); }
/** * Return the columns set for this version, based on the given templates. */ public Column[] getColumns(Version version, Column[] templates, boolean adapt) { if (spansMultipleTables(templates)) return getMultiTableColumns(version, templates, adapt); Table table = getSingleTable(version, templates); version.getMappingRepository().getMappingDefaults().populateColumns (version, table, templates); return createColumns(version, null, templates, table, adapt); }
/** * Update {@link MappingInfo} with our current mapping information. */ public void syncMappingInfo() { _info.syncWith(this); // setup the version field with our mapping info FieldMapping fm = _mapping.getVersionFieldMapping(); if (fm != null) { // erase explicit strategy if it is standard version strategy for // field type if (_info.getStrategy() != null && _info.getStrategy().equals(getMappingRepository(). defaultStrategy(this, fm).getAlias())) _info.setStrategy(null); fm.getMappingInfo().clear(); fm.getValueInfo().clear(); fm.getKeyMapping().getValueInfo().clear(); fm.getElementMapping().getValueInfo().clear(); fm.getValueInfo().copy(_info); _info.clear(); } }
/** * Update {@link MappingInfo} with our current mapping information. */ public void syncMappingInfo() { _info.syncWith(this); // setup the version field with our mapping info FieldMapping fm = _mapping.getVersionFieldMapping(); if (fm != null) { // erase explicit strategy if it is standard version strategy for // field type if (_info.getStrategy() != null && _info.getStrategy().equals(getMappingRepository(). defaultStrategy(this, fm).getAlias())) _info.setStrategy(null); fm.getMappingInfo().clear(); fm.getValueInfo().clear(); fm.getKeyMapping().getValueInfo().clear(); fm.getElementMapping().getValueInfo().clear(); fm.getValueInfo().copy(_info); _info.clear(); } }
/** * Update {@link MappingInfo} with our current mapping information. */ public void syncMappingInfo() { _info.syncWith(this); // setup the version field with our mapping info FieldMapping fm = _mapping.getVersionFieldMapping(); if (fm != null) { // erase explicit strategy if it is standard version strategy for // field type if (_info.getStrategy() != null && _info.getStrategy().equals(getMappingRepository(). defaultStrategy(this, fm).getAlias())) _info.setStrategy(null); fm.getMappingInfo().clear(); fm.getValueInfo().clear(); fm.getKeyMapping().getValueInfo().clear(); fm.getElementMapping().getValueInfo().clear(); fm.getValueInfo().copy(_info); _info.clear(); } }
/** * Setup mapping. */ private void resolveMapping() { // if there is a version field, copy mapping info from it FieldMapping fm = _mapping.getVersionFieldMapping(); if (fm != null) _info.copy(fm.getValueInfo()); // map strategy MappingRepository repos = getMappingRepository(); if (_strategy == null) repos.getStrategyInstaller().installStrategy(this); Log log = repos.getLog(); if (log.isTraceEnabled()) log.trace(_loc.get("strategy", this, _strategy.getAlias())); // mark columns as mapped Column[] cols = getColumns(); ColumnIO io = getColumnIO(); for (int i = 0; i < cols.length; i++) { if (io.isInsertable(i, false)) cols[i].setFlag(Column.FLAG_DIRECT_INSERT, true); if (io.isUpdatable(i, false)) cols[i].setFlag(Column.FLAG_DIRECT_UPDATE, true); } }
/** * Setup mapping. */ private void resolveMapping() { // if there is a version field, copy mapping info from it FieldMapping fm = _mapping.getVersionFieldMapping(); if (fm != null) _info.copy(fm.getValueInfo()); // map strategy MappingRepository repos = getMappingRepository(); if (_strategy == null) repos.getStrategyInstaller().installStrategy(this); Log log = repos.getLog(); if (log.isTraceEnabled()) log.trace(_loc.get("strategy", this, _strategy.getAlias())); // mark columns as mapped Column[] cols = getColumns(); ColumnIO io = getColumnIO(); for (int i = 0; i < cols.length; i++) { if (io.isInsertable(i, false)) cols[i].setFlag(Column.FLAG_DIRECT_INSERT, true); if (io.isUpdatable(i, false)) cols[i].setFlag(Column.FLAG_DIRECT_UPDATE, true); } }