/** * Validate the mappings for the given class and its fields. */ private void validate(Class<?> cls) { if (cls == null) return; MappingRepository repos = getRepository(); repos.setStrategyInstaller(new RuntimeStrategyInstaller(repos)); if (getMapping(repos, cls, true) != null) _flushSchema = !contains(_schemaActions,SCHEMA_ACTION_NONE) && !contains(_schemaActions,SchemaTool.ACTION_ADD); }
/** * Validate the mappings for the given class and its fields. */ private void validate(Class<?> cls) { if (cls == null) return; MappingRepository repos = getRepository(); repos.setStrategyInstaller(new RuntimeStrategyInstaller(repos)); if (getMapping(repos, cls, true) != null) _flushSchema = !contains(_schemaActions,SCHEMA_ACTION_NONE) && !contains(_schemaActions,SchemaTool.ACTION_ADD); }
/** * Validate the mappings for the given class and its fields. */ private void validate(Class<?> cls) { if (cls == null) return; MappingRepository repos = getRepository(); repos.setStrategyInstaller(new RuntimeStrategyInstaller(repos)); if (getMapping(repos, cls, true) != null) _flushSchema = !contains(_schemaActions,SCHEMA_ACTION_NONE) && !contains(_schemaActions,SchemaTool.ACTION_ADD); }
/** * Validate the mappings for the given class and its fields. */ private void validate(Class cls) { if (cls == null) return; MappingRepository repos = getRepository(); repos.setStrategyInstaller(new RuntimeStrategyInstaller(repos)); if (getMapping(repos, cls, true) != null) _flushSchema = !contains(_schemaActions,SCHEMA_ACTION_NONE) && !contains(_schemaActions,SchemaTool.ACTION_ADD); }
/** * Validate the mappings for the given class and its fields. */ private void validate(Class<?> cls) { if (cls == null) return; MappingRepository repos = getRepository(); repos.setStrategyInstaller(new RuntimeStrategyInstaller(repos)); if (getMapping(repos, cls, true) != null) _flushSchema = !contains(_schemaActions,SCHEMA_ACTION_NONE) && !contains(_schemaActions,SchemaTool.ACTION_ADD); }
/** * Drop mapping for given class. */ private void drop(Class<?> cls) { if (cls == null) return; if (_dropCls == null) _dropCls = new HashSet<Class<?>>(); _dropCls.add(cls); if (!contains(_schemaActions,SchemaTool.ACTION_DROP)) return; MappingRepository repos = getRepository(); repos.setStrategyInstaller(new RuntimeStrategyInstaller(repos)); ClassMapping mapping = null; try { mapping = repos.getMapping(cls, null, false); } catch (Exception e) { } if (mapping != null) { _flushSchema = true; if (_dropMap == null) _dropMap = new HashSet<ClassMapping>(); _dropMap.add(mapping); } else _log.warn(_loc.get("no-drop-meta", cls)); }
/** * Drop mapping for given class. */ private void drop(Class<?> cls) { if (cls == null) return; if (_dropCls == null) _dropCls = new HashSet<Class<?>>(); _dropCls.add(cls); if (!contains(_schemaActions,SchemaTool.ACTION_DROP)) return; MappingRepository repos = getRepository(); repos.setStrategyInstaller(new RuntimeStrategyInstaller(repos)); ClassMapping mapping = null; try { mapping = repos.getMapping(cls, null, false); } catch (Exception e) { } if (mapping != null) { _flushSchema = true; if (_dropMap == null) _dropMap = new HashSet<ClassMapping>(); _dropMap.add(mapping); } else _log.warn(_loc.get("no-drop-meta", cls)); }
/** * Drop mapping for given class. */ private void drop(Class<?> cls) { if (cls == null) return; if (_dropCls == null) _dropCls = new HashSet<Class<?>>(); _dropCls.add(cls); if (!contains(_schemaActions,SchemaTool.ACTION_DROP)) return; MappingRepository repos = getRepository(); repos.setStrategyInstaller(new RuntimeStrategyInstaller(repos)); ClassMapping mapping = null; try { mapping = repos.getMapping(cls, null, false); } catch (Exception e) { } if (mapping != null) { _flushSchema = true; if (_dropMap == null) _dropMap = new HashSet<ClassMapping>(); _dropMap.add(mapping); } else _log.warn(_loc.get("no-drop-meta", cls)); }
/** * Drop mapping for given class. */ private void drop(Class<?> cls) { if (cls == null) return; if (_dropCls == null) _dropCls = new HashSet<Class<?>>(); _dropCls.add(cls); if (!contains(_schemaActions,SchemaTool.ACTION_DROP)) return; MappingRepository repos = getRepository(); repos.setStrategyInstaller(new RuntimeStrategyInstaller(repos)); ClassMapping mapping = null; try { mapping = repos.getMapping(cls, null, false); } catch (Exception e) { } if (mapping != null) { _flushSchema = true; if (_dropMap == null) _dropMap = new HashSet<ClassMapping>(); _dropMap.add(mapping); } else _log.warn(_loc.get("no-drop-meta", cls)); }
/** * Drop mapping for given class. */ private void drop(Class cls) { if (cls == null) return; if (_dropCls == null) _dropCls = new HashSet(); _dropCls.add(cls); if (!contains(_schemaActions,SchemaTool.ACTION_DROP)) return; MappingRepository repos = getRepository(); repos.setStrategyInstaller(new RuntimeStrategyInstaller(repos)); ClassMapping mapping = null; try { mapping = repos.getMapping(cls, null, false); } catch (Exception e) { } if (mapping != null) { _flushSchema = true; if (_dropMap == null) _dropMap = new HashSet(); _dropMap.add(mapping); } else _log.warn(_loc.get("no-drop-meta", cls)); }
/** * Return the schema group to use in mapping. If none has been set, the * schema will be generated from the database. */ public SchemaGroup getSchemaGroup() { if (_schema == null) { if (_action.indexOf(ACTION_BUILD_SCHEMA) != -1) { DynamicSchemaFactory factory = new DynamicSchemaFactory(); factory.setConfiguration(_conf); _schema = factory; } else if (_readSchema || contains(_schemaActions,SchemaTool.ACTION_RETAIN) || contains(_schemaActions,SchemaTool.ACTION_REFRESH)) { _schema = (SchemaGroup) newSchemaTool(null).getDBSchemaGroup(). clone(); } else { // with this we'll just read tables as different mappings // look for them LazySchemaFactory factory = new LazySchemaFactory(); factory.setConfiguration(_conf); factory.setPrimaryKeys(getPrimaryKeys()); factory.setForeignKeys(getForeignKeys()); factory.setIndexes(getIndexes()); _schema = factory; } if (_schema.getSchemas().length == 0) _schema.addSchema(); } return _schema; }
/** * Return the schema group to use in mapping. If none has been set, the * schema will be generated from the database. */ public SchemaGroup getSchemaGroup() { if (_schema == null) { if (_action.indexOf(ACTION_BUILD_SCHEMA) != -1) { DynamicSchemaFactory factory = new DynamicSchemaFactory(); factory.setConfiguration(_conf); _schema = factory; } else if (_readSchema || contains(_schemaActions,SchemaTool.ACTION_RETAIN) || contains(_schemaActions,SchemaTool.ACTION_REFRESH)) { _schema = (SchemaGroup) newSchemaTool(null).getDBSchemaGroup(). clone(); } else { // with this we'll just read tables as different mappings // look for them LazySchemaFactory factory = new LazySchemaFactory(); factory.setConfiguration(_conf); factory.setPrimaryKeys(getPrimaryKeys()); factory.setForeignKeys(getForeignKeys()); factory.setIndexes(getIndexes()); _schema = factory; } if (_schema.getSchemas().length == 0) _schema.addSchema(); } return _schema; }
/** * Return the schema group to use in mapping. If none has been set, the * schema will be generated from the database. */ public SchemaGroup getSchemaGroup() { if (_schema == null) { if (_action.indexOf(ACTION_BUILD_SCHEMA) != -1) { DynamicSchemaFactory factory = new DynamicSchemaFactory(); factory.setConfiguration(_conf); _schema = factory; } else if (_readSchema || contains(_schemaActions,SchemaTool.ACTION_RETAIN) || contains(_schemaActions,SchemaTool.ACTION_REFRESH)) { _schema = (SchemaGroup) newSchemaTool(null).getDBSchemaGroup(). clone(); } else { // with this we'll just read tables as different mappings // look for them LazySchemaFactory factory = new LazySchemaFactory(); factory.setConfiguration(_conf); factory.setPrimaryKeys(getPrimaryKeys()); factory.setForeignKeys(getForeignKeys()); factory.setIndexes(getIndexes()); _schema = factory; } if (_schema.getSchemas().length == 0) _schema.addSchema(); } return _schema; }
/** * Return the schema group to use in mapping. If none has been set, the * schema will be generated from the database. */ public SchemaGroup getSchemaGroup() { if (_schema == null) { if (_action.indexOf(ACTION_BUILD_SCHEMA) != -1) { DynamicSchemaFactory factory = new DynamicSchemaFactory(); factory.setConfiguration(_conf); _schema = factory; } else if (_readSchema || contains(_schemaActions,SchemaTool.ACTION_RETAIN) || contains(_schemaActions,SchemaTool.ACTION_REFRESH)) { _schema = (SchemaGroup) newSchemaTool(null).getDBSchemaGroup(). clone(); } else { // with this we'll just read tables as different mappings // look for them LazySchemaFactory factory = new LazySchemaFactory(); factory.setConfiguration(_conf); factory.setPrimaryKeys(getPrimaryKeys()); factory.setForeignKeys(getForeignKeys()); factory.setIndexes(getIndexes()); _schema = factory; } if (_schema.getSchemas().length == 0) _schema.addSchema(); } return _schema; }
/** * Return the schema group to use in mapping. If none has been set, the * schema will be generated from the database. */ public SchemaGroup getSchemaGroup() { if (_schema == null) { if (_action.indexOf(ACTION_BUILD_SCHEMA) != -1) { DynamicSchemaFactory factory = new DynamicSchemaFactory(); factory.setConfiguration(_conf); _schema = factory; } else if (_readSchema || contains(_schemaActions,SchemaTool.ACTION_RETAIN) || contains(_schemaActions,SchemaTool.ACTION_REFRESH)) { _schema = (SchemaGroup) newSchemaTool(null).getDBSchemaGroup(). clone(); } else { // with this we'll just read tables as different mappings // look for them LazySchemaFactory factory = new LazySchemaFactory(); factory.setConfiguration(_conf); factory.setPrimaryKeys(getPrimaryKeys()); factory.setForeignKeys(getForeignKeys()); factory.setIndexes(getIndexes()); _schema = factory; } if (_schema.getSchemas().length == 0) _schema.addSchema(); } return _schema; }