/** * Candidate mapping. */ public ClassMapping getCandidateTypeMapping() { if (_candidateMap == null) _candidateMap = _repos.getMapping(_candidate, null, true); return _candidateMap; }
/** * Candidate mapping. */ public ClassMapping getCandidateTypeMapping() { if (_candidateMap == null) _candidateMap = _repos.getMapping(_candidate, null, true); return _candidateMap; }
/** * Candidate mapping. */ public ClassMapping getCandidateTypeMapping() { if (_candidateMap == null) _candidateMap = _repos.getMapping(_candidate, null, true); return _candidateMap; }
/** * Candidate mapping. */ public ClassMapping getCandidateTypeMapping() { if (_candidateMap == null) _candidateMap = _repos.getMapping(_candidate, null, true); return _candidateMap; }
/** * Candidate mapping. */ public ClassMapping getCandidateTypeMapping() { if (_candidateMap == null) _candidateMap = _repos.getMapping(_candidate, null, true); return _candidateMap; }
/** * Return the mapping for the given type, or null if the type is * persistence-aware. */ private static ClassMapping getMapping(MappingRepository repos, Class<?> cls, boolean validate) { // this will parse all possible metadata rsrcs looking for cls, so // will detect if p-aware ClassMapping mapping = repos.getMapping(cls, null, false); if (mapping != null) return mapping; if (!validate || cls.isInterface() || repos.getPersistenceAware(cls) != null) return null; throw new MetaDataException(_loc.get("no-meta", cls, cls.getClassLoader())); }
/** * Return the mapping for the given type, or null if the type is * persistence-aware. */ private static ClassMapping getMapping(MappingRepository repos, Class<?> cls, boolean validate) { // this will parse all possible metadata rsrcs looking for cls, so // will detect if p-aware ClassMapping mapping = repos.getMapping(cls, null, false); if (mapping != null) return mapping; if (!validate || cls.isInterface() || repos.getPersistenceAware(cls) != null) return null; throw new MetaDataException(_loc.get("no-meta", cls, cls.getClassLoader())); }
/** * Return the mapping for the given type, or null if the type is * persistence-aware. */ private static ClassMapping getMapping(MappingRepository repos, Class<?> cls, boolean validate) { // this will parse all possible metadata rsrcs looking for cls, so // will detect if p-aware ClassMapping mapping = repos.getMapping(cls, null, false); if (mapping != null) return mapping; if (!validate || cls.isInterface() || repos.getPersistenceAware(cls) != null) return null; throw new MetaDataException(_loc.get("no-meta", cls, cls.getClassLoader())); }
/** * Return the mapping for the given type, or null if the type is * persistence-aware. */ private static ClassMapping getMapping(MappingRepository repos, Class<?> cls, boolean validate) { // this will parse all possible metadata rsrcs looking for cls, so // will detect if p-aware ClassMapping mapping = repos.getMapping(cls, null, false); if (mapping != null) return mapping; if (!validate || cls.isInterface() || repos.getPersistenceAware(cls) != null) return null; throw new MetaDataException(_loc.get("no-meta", cls, cls.getClassLoader())); }
/** * Return the mapping for the given type, or null if the type is * persistence-aware. */ private static ClassMapping getMapping(MappingRepository repos, Class cls, boolean validate) { // this will parse all possible metadata rsrcs looking for cls, so // will detect if p-aware ClassMapping mapping = repos.getMapping(cls, null, false); if (mapping != null) return mapping; if (!validate || cls.isInterface() || repos.getPersistenceAware(cls) != null) return null; throw new MetaDataException(_loc.get("no-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)); }
/** * Constructor. * * @param pcClass the base class of the result objects * @param store the store manager to delegate loading to * @param fetch the fetch configuration, or null for default * @param res the result containing the data */ public GenericResultObjectProvider(Class<?> pcClass, JDBCStore store, JDBCFetchConfiguration fetch, Result res) { this(store.getConfiguration().getMappingRepositoryInstance().getMapping (pcClass, store.getContext().getClassLoader(), true), store, fetch, res); }
/** * Constructor. * * @param pcClass the base class of the result objects * @param store the store manager to delegate loading to * @param fetch the fetch configuration, or null for default * @param res the result containing the data */ public GenericResultObjectProvider(Class<?> pcClass, JDBCStore store, JDBCFetchConfiguration fetch, Result res) { this(store.getConfiguration().getMappingRepositoryInstance().getMapping (pcClass, store.getContext().getClassLoader(), true), store, fetch, res); }
/** * Constructor. * * @param pcClass the base class of the result objects * @param store the store manager to delegate loading to * @param fetch the fetch configuration, or null for default * @param res the result containing the data */ public GenericResultObjectProvider(Class<?> pcClass, JDBCStore store, JDBCFetchConfiguration fetch, Result res) { this(store.getConfiguration().getMappingRepositoryInstance().getMapping (pcClass, store.getContext().getClassLoader(), true), store, fetch, res); }
/** * Constructor. * * @param pcClass the base class of the result objects * @param store the store manager to delegate loading to * @param fetch the fetch configuration, or null for default * @param res the result containing the data */ public GenericResultObjectProvider(Class pcClass, JDBCStore store, JDBCFetchConfiguration fetch, Result res) { this(store.getConfiguration().getMappingRepositoryInstance().getMapping (pcClass, store.getContext().getClassLoader(), true), store, fetch, res); }
/** * Constructor. * * @param pcClass the base class of the result objects * @param store the store manager to delegate loading to * @param fetch the fetch configuration, or null for default * @param res the result containing the data */ public GenericResultObjectProvider(Class<?> pcClass, JDBCStore store, JDBCFetchConfiguration fetch, Result res) { this(store.getConfiguration().getMappingRepositoryInstance().getMapping (pcClass, store.getContext().getClassLoader(), true), store, fetch, res); }
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { super.calculateValue(sel, ctx, state, other, otherState); Object val = getValue(ctx.params); ParamExpState pstate = (ParamExpState) state; if (other != null && !_container) { pstate.sqlValue = other.toDataStoreValue(sel, ctx, otherState, val); pstate.otherLength = other.length(sel, ctx, otherState); } else if (ImplHelper.isManageable(val)) { ClassMapping mapping = ctx.store.getConfiguration(). getMappingRepositoryInstance().getMapping(val.getClass(), ctx.store.getContext().getClassLoader(), true); pstate.sqlValue = mapping.toDataStoreValue(val, mapping.getPrimaryKeyColumns(), ctx.store); pstate.otherLength = mapping.getPrimaryKeyColumns().length; } else pstate.sqlValue = val; }
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { super.calculateValue(sel, ctx, state, other, otherState); Object val = getValue(ctx.params); ParamExpState pstate = (ParamExpState) state; if (other != null && !_container) { pstate.sqlValue = other.toDataStoreValue(sel, ctx, otherState, val); pstate.otherLength = other.length(sel, ctx, otherState); if (other instanceof Type) { pstate.mapping = ctx.store.getConfiguration(). getMappingRepositoryInstance().getMapping((Class) val, ctx.store.getContext().getClassLoader(), true); pstate.disc = pstate.mapping.getDiscriminator(); pstate.discValue = pstate.disc.getValue() != null ? pstate.disc.getValue() : "1"; } } else if (ImplHelper.isManageable(val)) { ClassMapping mapping = ctx.store.getConfiguration(). getMappingRepositoryInstance().getMapping(val.getClass(), ctx.store.getContext().getClassLoader(), true); pstate.sqlValue = mapping.toDataStoreValue(val, mapping.getPrimaryKeyColumns(), ctx.store); pstate.otherLength = mapping.getPrimaryKeyColumns().length; } else pstate.sqlValue = val; }
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { super.calculateValue(sel, ctx, state, other, otherState); Object val = getValue(ctx.params); ParamExpState pstate = (ParamExpState) state; if (other != null && !_container) { pstate.sqlValue = other.toDataStoreValue(sel, ctx, otherState, val); pstate.otherLength = other.length(sel, ctx, otherState); if (other instanceof Type) { pstate.mapping = ctx.store.getConfiguration(). getMappingRepositoryInstance().getMapping((Class) val, ctx.store.getContext().getClassLoader(), true); pstate.disc = pstate.mapping.getDiscriminator(); pstate.discValue = pstate.disc.getValue() != null ? pstate.disc.getValue() : "1"; } } else if (ImplHelper.isManageable(val)) { ClassMapping mapping = ctx.store.getConfiguration(). getMappingRepositoryInstance().getMapping(val.getClass(), ctx.store.getContext().getClassLoader(), true); pstate.sqlValue = mapping.toDataStoreValue(val, mapping.getPrimaryKeyColumns(), ctx.store); pstate.otherLength = mapping.getPrimaryKeyColumns().length; } else pstate.sqlValue = val; }
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { super.calculateValue(sel, ctx, state, other, otherState); Object val = getValue(ctx.params); ParamExpState pstate = (ParamExpState) state; if (other != null && !_container) { pstate.sqlValue = other.toDataStoreValue(sel, ctx, otherState, val); pstate.otherLength = other.length(sel, ctx, otherState); if (other instanceof Type) { pstate.mapping = ctx.store.getConfiguration(). getMappingRepositoryInstance().getMapping((Class) val, ctx.store.getContext().getClassLoader(), true); pstate.disc = pstate.mapping.getDiscriminator(); pstate.discValue = pstate.disc.getValue() != null ? pstate.disc.getValue() : "1"; } } else if (ImplHelper.isManageable(val)) { ClassMapping mapping = ctx.store.getConfiguration(). getMappingRepositoryInstance().getMapping(val.getClass(), ctx.store.getContext().getClassLoader(), true); pstate.sqlValue = mapping.toDataStoreValue(val, mapping.getPrimaryKeyColumns(), ctx.store); pstate.otherLength = mapping.getPrimaryKeyColumns().length; } else pstate.sqlValue = val; }