/** * Determine if the given field needs to be selected. */ private static boolean requiresSelect(FieldMapping fm, OpenJPAStateManager sm, BitSet fields, JDBCFetchConfiguration fetch) { if (fields != null) return fields.get(fm.getIndex()); if (sm != null && sm.getPCState() != PCState.TRANSIENT && sm.getLoaded().get(fm.getIndex())) return false; return fetch.requiresFetch(fm) == FetchConfiguration.FETCH_LOAD; }
/** * Determine if the given field needs to be selected. */ private static boolean requiresSelect(FieldMapping fm, OpenJPAStateManager sm, BitSet fields, JDBCFetchConfiguration fetch) { if (fields != null) return fields.get(fm.getIndex()); if (sm != null && sm.getPCState() != PCState.TRANSIENT && sm.getLoaded().get(fm.getIndex())) return false; return fetch.requiresFetch(fm) == FetchConfiguration.FETCH_LOAD; }
/** * Determine if the given field needs to be selected. */ private static boolean requiresSelect(FieldMapping fm, OpenJPAStateManager sm, BitSet fields, JDBCFetchConfiguration fetch) { if (fields != null) return fields.get(fm.getIndex()); if (sm != null && sm.getPCState() != PCState.TRANSIENT && sm.getLoaded().get(fm.getIndex())) return false; return fetch.requiresFetch(fm) == FetchConfiguration.FETCH_LOAD; }
/** * Determine if the given field needs to be selected. */ private static boolean requiresSelect(FieldMapping fm, OpenJPAStateManager sm, BitSet fields, JDBCFetchConfiguration fetch) { if (fields != null) return fields.get(fm.getIndex()); if (sm != null && sm.getPCState() != PCState.TRANSIENT && sm.getLoaded().get(fm.getIndex())) return false; return fetch.requiresFetch(fm) == FetchConfiguration.FETCH_LOAD; }
/** * Determine if the given field needs to be selected. */ private static boolean requiresSelect(FieldMapping fm, OpenJPAStateManager sm, BitSet fields, JDBCFetchConfiguration fetch) { if (fields != null) return fields.get(fm.getIndex()); if (sm != null && sm.getPCState() != PCState.TRANSIENT && sm.getLoaded().get(fm.getIndex())) return false; return fetch.requiresFetch(fm) == FetchConfiguration.FETCH_LOAD; }
/** * Returns the fields of the state that require an update. * * @param sm the state to check * @return the BitSet of fields that need update, or null if none */ public static BitSet getUpdateFields(OpenJPAStateManager sm) { if ((sm.getPCState() == PCState.PDIRTY && (!sm.isFlushed() || sm.isFlushedDirty())) || (sm.getPCState() == PCState.PNEW && sm.isFlushedDirty())) { BitSet dirty = sm.getDirty(); if (sm.isFlushed()) { dirty = (BitSet) dirty.clone(); dirty.andNot(sm.getFlushed()); } if (dirty.length() > 0) return dirty; } return null; }
/** * Returns the fields of the state that require an update. * * @param sm the state to check * @return the BitSet of fields that need update, or null if none */ public static BitSet getUpdateFields(OpenJPAStateManager sm) { if ((sm.getPCState() == PCState.PDIRTY && (!sm.isFlushed() || sm.isFlushedDirty())) || (sm.getPCState() == PCState.PNEW && sm.isFlushedDirty())) { BitSet dirty = sm.getDirty(); if (sm.isFlushed()) { dirty = (BitSet) dirty.clone(); dirty.andNot(sm.getFlushed()); } if (dirty.length() > 0) return dirty; } return null; }
/** * When selecting fieldes, a special case is made for mappings that use * 2-part selects that aren't explicitly *not* in the dfg so that they * can get their primary table data. This method tests for that special * case as an optimization. */ private boolean optSelect(FieldMapping fm, Select sel, OpenJPAStateManager sm, JDBCFetchConfiguration fetch) { return !fm.isInDefaultFetchGroup() && !fm.isDefaultFetchGroupExplicit() && (sm == null || sm.getPCState() == PCState.TRANSIENT || !sm.getLoaded().get(fm.getIndex())) && fm.supportsSelect(sel, sel.TYPE_TWO_PART, sm, this, fetch) > 0; }
/** * When selecting fields, a special case is made for mappings that use 2-part selects that aren't explicitly *not* * in the dfg so that they can get their primary table data. This method tests for that special case as an * optimization. */ private boolean optSelect(FieldMapping fm, Select sel, OpenJPAStateManager sm, JDBCFetchConfiguration fetch) { boolean dfg = fetch.getIgnoreDfgForFkSelect() || !fm.isInDefaultFetchGroup() && !fm.isDefaultFetchGroupExplicit(); return dfg && (sm == null || sm.getPCState() == PCState.TRANSIENT || !sm.getLoaded().get(fm.getIndex())) && fm.supportsSelect(sel, Select.TYPE_TWO_PART, sm, this, fetch) > 0; }
/** * When selecting fields, a special case is made for mappings that use 2-part selects that aren't explicitly *not* * in the dfg so that they can get their primary table data. This method tests for that special case as an * optimization. */ private boolean optSelect(FieldMapping fm, Select sel, OpenJPAStateManager sm, JDBCFetchConfiguration fetch) { boolean dfg = fetch.getIgnoreDfgForFkSelect() || !fm.isInDefaultFetchGroup() && !fm.isDefaultFetchGroupExplicit(); return dfg && (sm == null || sm.getPCState() == PCState.TRANSIENT || !sm.getLoaded().get(fm.getIndex())) && fm.supportsSelect(sel, Select.TYPE_TWO_PART, sm, this, fetch) > 0; }
/** * When selecting fields, a special case is made for mappings that use 2-part selects that aren't explicitly *not* * in the dfg so that they can get their primary table data. This method tests for that special case as an * optimization. */ private boolean optSelect(FieldMapping fm, Select sel, OpenJPAStateManager sm, JDBCFetchConfiguration fetch) { boolean dfg = fetch.getIgnoreDfgForFkSelect() || !fm.isInDefaultFetchGroup() && !fm.isDefaultFetchGroupExplicit(); return dfg && (sm == null || sm.getPCState() == PCState.TRANSIENT || !sm.getLoaded().get(fm.getIndex())) && fm.supportsSelect(sel, Select.TYPE_TWO_PART, sm, this, fetch) > 0; }
/** * When selecting fields, a special case is made for mappings that use 2-part selects that aren't explicitly *not* * in the dfg so that they can get their primary table data. This method tests for that special case as an * optimization. */ private boolean optSelect(FieldMapping fm, Select sel, OpenJPAStateManager sm, JDBCFetchConfiguration fetch) { boolean dfg = fetch.getIgnoreDfgForFkSelect() || !fm.isInDefaultFetchGroup() && !fm.isDefaultFetchGroupExplicit(); return dfg && (sm == null || sm.getPCState() == PCState.TRANSIENT || !sm.getLoaded().get(fm.getIndex())) && fm.supportsSelect(sel, Select.TYPE_TWO_PART, sm, this, fetch) > 0; }
/** * Return whether the given instance needs loading before being returned * to the user. */ private boolean requiresLoad(OpenJPAStateManager sm, boolean initialized, FetchConfiguration fetch, Object edata, int flags) { if (!fetch.requiresLoad()) return false; if ((flags & OID_NOVALIDATE) == 0) return true; if (edata != null) // take advantage of existing result return true; if (initialized && sm.getPCState() != PCState.HOLLOW) return false; if (!initialized && sm.getMetaData().getPCSubclasses().length > 0) return true; return !_compat.getValidateFalseReturnsHollow(); }
/** * Return whether the given instance needs loading before being returned * to the user. */ private boolean requiresLoad(OpenJPAStateManager sm, boolean initialized, FetchConfiguration fetch, Object edata, int flags) { if (!fetch.requiresLoad()) return false; if ((flags & OID_NOVALIDATE) == 0) return true; if (edata != null) // take advantage of existing result return true; if (initialized && sm.getPCState() != PCState.HOLLOW) return false; if (!initialized && sm.getMetaData().getPCSubclasses().length > 0) return true; return !_compat.getValidateFalseReturnsHollow(); }
/** * Return whether the given instance needs loading before being returned * to the user. */ private boolean requiresLoad(OpenJPAStateManager sm, boolean initialized, FetchConfiguration fetch, Object edata, int flags) { if (!fetch.requiresLoad()) return false; if ((flags & OID_NOVALIDATE) == 0) return true; if (edata != null) // take advantage of existing result return true; if (initialized && sm.getPCState() != PCState.HOLLOW) return false; if (!initialized && sm.getMetaData().getPCSubclasses().length > 0) return true; return !_compat.getValidateFalseReturnsHollow(); }
/** * Return whether the given instance needs loading before being returned * to the user. */ private boolean requiresLoad(OpenJPAStateManager sm, boolean initialized, FetchConfiguration fetch, Object edata, int flags) { if (!fetch.requiresLoad()) return false; if ((flags & OID_NOVALIDATE) == 0) return true; if (edata != null) // take advantage of existing result return true; if (initialized && sm.getPCState() != PCState.HOLLOW) return false; if (!initialized && sm.getMetaData().getPCSubclasses().length > 0) return true; return !_compat.getValidateFalseReturnsHollow(); }
/** * Return whether the given instance needs loading before being returned * to the user. */ private boolean requiresLoad(OpenJPAStateManager sm, boolean initialized, FetchConfiguration fetch, Object edata, int flags) { if (!fetch.requiresLoad()) return false; if ((flags & OID_NOVALIDATE) == 0) return true; if (edata != null) // take advantage of existing result return true; if (initialized && sm.getPCState() != PCState.HOLLOW) return false; if (!initialized && sm.getMetaData().getPCSubclasses().length > 0) return true; return !_compat.getValidateFalseReturnsHollow(); }
private boolean needClassCondition(ClassMapping mapping, int subs, OpenJPAStateManager sm) { boolean retVal = false; if(sm == null || sm.getPCState() == PCState.TRANSIENT) { if(subs == Select.SUBS_JOINABLE || subs == Select.SUBS_NONE) { retVal = true; } else { if (mapping.getDiscriminator() != null && SuperclassDiscriminatorStrategy.class.isInstance(mapping.getDiscriminator().getStrategy()) && mapping.getMappingRepository().getConfiguration().getCompatibilityInstance() .getSuperclassDiscriminatorStrategyByDefault()) { retVal = true; } } } return retVal; }
private boolean needClassCondition(ClassMapping mapping, int subs, OpenJPAStateManager sm) { boolean retVal = false; if(sm == null || sm.getPCState() == PCState.TRANSIENT) { if(subs == Select.SUBS_JOINABLE || subs == Select.SUBS_NONE) { retVal = true; } else { if (mapping.getDiscriminator() != null && SuperclassDiscriminatorStrategy.class.isInstance(mapping.getDiscriminator().getStrategy()) && mapping.getMappingRepository().getConfiguration().getCompatibilityInstance() .getSuperclassDiscriminatorStrategyByDefault()) { retVal = true; } } } return retVal; }
private boolean needClassCondition(ClassMapping mapping, int subs, OpenJPAStateManager sm) { boolean retVal = false; if(sm == null || sm.getPCState() == PCState.TRANSIENT) { if(subs == Select.SUBS_JOINABLE || subs == Select.SUBS_NONE) { retVal = true; } else { if (mapping.getDiscriminator() != null && SuperclassDiscriminatorStrategy.class.isInstance(mapping.getDiscriminator().getStrategy()) && mapping.getMappingRepository().getConfiguration().getCompatibilityInstance() .getSuperclassDiscriminatorStrategyByDefault()) { retVal = true; } } } return retVal; }