/** * Remove a declared fetch group. */ public boolean removeDeclaredFetchGroup(FetchGroup fg) { if (fg == null) return false; if (_fgMap.remove(fg.getName()) != null) { _fgs = null; _customFGs = null; return true; } return false; }
/** * Remove a declared fetch group. */ public boolean removeDeclaredFetchGroup(FetchGroup fg) { if (fg == null) return false; if (_fgMap.remove(fg.getName()) != null) { _fgs = null; _customFGs = null; return true; } return false; }
/** * Remove a declared fetch group. */ public boolean removeDeclaredFetchGroup(FetchGroup fg) { if (fg == null) return false; if (_fgMap.remove(fg.getName()) != null) { _fgs = null; _customFGs = null; return true; } return false; }
/** * Remove a declared fetch group. */ public boolean removeDeclaredFetchGroup(FetchGroup fg) { if (fg == null) return false; if (_fgMap.remove(fg.getName()) != null) { _fgs = null; _customFGs = null; return true; } return false; }
/** * Remove a declared fetch group. */ public boolean removeDeclaredFetchGroup(FetchGroup fg) { if (fg == null) return false; if (_fgMap.remove(fg.getName()) != null) { _fgs = null; _customFGs = null; return true; } return false; }
/** * Adds this receiver as one of the included fetch groups of the given * parent. * The parent fetch group will include this receiver as a side-effect of * this call. * * @see #includes(String, boolean) * @see #addDeclaredInclude(String) * * @return true if given parent is a new addition. false othrwise. * @since 1.1.0 */ public boolean addContainedBy(FetchGroup parent) { parent.addDeclaredInclude(this.getName()); if (_containedBy==null) _containedBy = new HashSet<String>(); return _containedBy.add(parent.getName()); }
/** * Adds this receiver as one of the included fetch groups of the given * parent. * The parent fecth group will include this receiver as a side-effect of * this call. * * @see #includes(String, boolean) * @see #addDeclaredInclude(String) * * @return true if given parent is a new addition. false othrwise. * @since 1.1.0 */ public boolean addContainedBy(FetchGroup parent) { parent.addDeclaredInclude(this.getName()); if (_containedBy==null) _containedBy = new HashSet(); return _containedBy.add(parent.getName()); }
/** * Adds this receiver as one of the included fetch groups of the given * parent. * The parent fetch group will include this receiver as a side-effect of * this call. * * @see #includes(String, boolean) * @see #addDeclaredInclude(String) * * @return true if given parent is a new addition. false othrwise. * @since 1.1.0 */ public boolean addContainedBy(FetchGroup parent) { parent.addDeclaredInclude(this.getName()); if (_containedBy==null) _containedBy = new HashSet<String>(); return _containedBy.add(parent.getName()); }
/** * Adds this receiver as one of the included fetch groups of the given * parent. * The parent fetch group will include this receiver as a side-effect of * this call. * * @see #includes(String, boolean) * @see #addDeclaredInclude(String) * * @return true if given parent is a new addition. false othrwise. * @since 1.1.0 */ public boolean addContainedBy(FetchGroup parent) { parent.addDeclaredInclude(this.getName()); if (_containedBy==null) _containedBy = new HashSet<String>(); return _containedBy.add(parent.getName()); }
/** * Adds this receiver as one of the included fetch groups of the given * parent. * The parent fetch group will include this receiver as a side-effect of * this call. * * @see #includes(String, boolean) * @see #addDeclaredInclude(String) * * @return true if given parent is a new addition. false othrwise. * @since 1.1.0 */ public boolean addContainedBy(FetchGroup parent) { parent.addDeclaredInclude(this.getName()); if (_containedBy==null) _containedBy = new HashSet<String>(); return _containedBy.add(parent.getName()); }
/** * Return all fetch groups for this type, including superclass groups but excluding the standard groups * such as "default" or "all". */ public FetchGroup[] getCustomFetchGroups() { if (_customFGs == null) { // map fetch groups to names, allowing our groups to override super Map<String,FetchGroup> fgs = new HashMap<String,FetchGroup>(); ClassMetaData sup = getPCSuperclassMetaData(); if (sup != null) { FetchGroup[] supFGs = sup.getCustomFetchGroups(); for (int i = 0; i < supFGs.length; i++) { fgs.put(supFGs[i].getName(), supFGs[i]); } } FetchGroup[] decs = getDeclaredFetchGroups(); for (int i = 0; i < decs.length; i++) { fgs.put(decs[i].getName(), decs[i]); } // remove standard groups fgs.remove(FetchGroup.NAME_DEFAULT); fgs.remove(FetchGroup.NAME_ALL); _customFGs = fgs.values().toArray(new FetchGroup[fgs.size()]); } return _customFGs; }
/** * Return all fetch groups for this type, including superclass groups but excluding the standard groups * such as "default" or "all". */ public FetchGroup[] getCustomFetchGroups() { if (_customFGs == null) { // map fetch groups to names, allowing our groups to override super Map<String,FetchGroup> fgs = new HashMap<String,FetchGroup>(); ClassMetaData sup = getPCSuperclassMetaData(); if (sup != null) { FetchGroup[] supFGs = sup.getCustomFetchGroups(); for (int i = 0; i < supFGs.length; i++) { fgs.put(supFGs[i].getName(), supFGs[i]); } } FetchGroup[] decs = getDeclaredFetchGroups(); for (int i = 0; i < decs.length; i++) { fgs.put(decs[i].getName(), decs[i]); } // remove standard groups fgs.remove(FetchGroup.NAME_DEFAULT); fgs.remove(FetchGroup.NAME_ALL); _customFGs = fgs.values().toArray(new FetchGroup[fgs.size()]); } return _customFGs; }
/** * Return all fetch groups for this type, including superclass groups but excluding the standard groups * such as "default" or "all". */ public FetchGroup[] getCustomFetchGroups() { if (_customFGs == null) { // map fetch groups to names, allowing our groups to override super Map<String,FetchGroup> fgs = new HashMap<String,FetchGroup>(); ClassMetaData sup = getPCSuperclassMetaData(); if (sup != null) { FetchGroup[] supFGs = sup.getCustomFetchGroups(); for (int i = 0; i < supFGs.length; i++) { fgs.put(supFGs[i].getName(), supFGs[i]); } } FetchGroup[] decs = getDeclaredFetchGroups(); for (int i = 0; i < decs.length; i++) { fgs.put(decs[i].getName(), decs[i]); } // remove standard groups fgs.remove(FetchGroup.NAME_DEFAULT); fgs.remove(FetchGroup.NAME_ALL); _customFGs = fgs.values().toArray(new FetchGroup[fgs.size()]); } return _customFGs; }
/** * Return all fetch groups for this type, including superclass groups. */ public FetchGroup[] getCustomFetchGroups() { if (_customFGs == null) { // map fgs to names, allowing our fgs to override supers Map fgs = new HashMap(); ClassMetaData sup = getPCSuperclassMetaData(); if (sup != null) { FetchGroup[] supFGs = sup.getCustomFetchGroups(); for (int i = 0; i < supFGs.length; i++) fgs.put(supFGs[i].getName(), supFGs[i]); } FetchGroup[] decs = getDeclaredFetchGroups(); for (int i = 0; i < decs.length; i++) fgs.put(decs[i].getName(), decs[i]); // remove std groups fgs.remove(FetchGroup.NAME_DEFAULT); fgs.remove(FetchGroup.NAME_ALL); _customFGs = (FetchGroup[]) fgs.values().toArray (new FetchGroup[fgs.size()]); } return _customFGs; }
/** * Set a field's fetch group. */ private static void parseFetchAttribute(ClassMetaData meta, org.apache.openjpa.meta.FetchGroup fg, FetchAttributeImpl attr) { FieldMetaData field = meta.getDeclaredField(attr.name()); if (field == null || field.getManagement() != FieldMetaData.MANAGE_PERSISTENT) throw new MetaDataException(_loc.get("bad-fg-field", fg.getName(), meta, attr.name())); field.setInFetchGroup(fg.getName(), true); Set<String> parentFetchGroups = fg.getContainedBy(); for (Object parentFetchGroup : parentFetchGroups) field.setInFetchGroup(parentFetchGroup.toString(), true); if (attr.recursionDepth() != Integer.MIN_VALUE) fg.setRecursionDepth(field, attr.recursionDepth()); }
/** * Set a field's fetch group. */ private void parseFetchAttribute(ClassMetaData meta, org.apache.openjpa.meta.FetchGroup fg, FetchAttribute attr) { FieldMetaData field = meta.getDeclaredField(attr.name()); if (field == null || field.getManagement() != FieldMetaData.MANAGE_PERSISTENT) throw new MetaDataException(_loc.get("bad-fg-field", fg.getName(), meta, attr.name())); field.setInFetchGroup(fg.getName(), true); Set parentFetchGroups = fg.getContainedBy(); for (Object parentFetchGroup:parentFetchGroups) field.setInFetchGroup(parentFetchGroup.toString(), true); if (attr.recursionDepth() != Integer.MIN_VALUE) fg.setRecursionDepth(field, attr.recursionDepth()); }
/** * Set a field's fetch group. */ private static void parseFetchAttribute(ClassMetaData meta, org.apache.openjpa.meta.FetchGroup fg, FetchAttributeImpl attr) { FieldMetaData field = meta.getDeclaredField(attr.name()); if (field == null || field.getManagement() != FieldMetaData.MANAGE_PERSISTENT) throw new MetaDataException(_loc.get("bad-fg-field", fg.getName(), meta, attr.name())); field.setInFetchGroup(fg.getName(), true); Set<String> parentFetchGroups = fg.getContainedBy(); for (Object parentFetchGroup : parentFetchGroups) field.setInFetchGroup(parentFetchGroup.toString(), true); if (attr.recursionDepth() != Integer.MIN_VALUE) fg.setRecursionDepth(field, attr.recursionDepth()); }
/** * Set a field's fetch group. */ private static void parseFetchAttribute(ClassMetaData meta, org.apache.openjpa.meta.FetchGroup fg, FetchAttributeImpl attr) { FieldMetaData field = meta.getDeclaredField(attr.name()); if (field == null || field.getManagement() != FieldMetaData.MANAGE_PERSISTENT) throw new MetaDataException(_loc.get("bad-fg-field", fg.getName(), meta, attr.name())); field.setInFetchGroup(fg.getName(), true); Set<String> parentFetchGroups = fg.getContainedBy(); for (Object parentFetchGroup : parentFetchGroups) field.setInFetchGroup(parentFetchGroup.toString(), true); if (attr.recursionDepth() != Integer.MIN_VALUE) fg.setRecursionDepth(field, attr.recursionDepth()); }
/** * Set a field's fetch group. */ private static void parseFetchAttribute(ClassMetaData meta, org.apache.openjpa.meta.FetchGroup fg, FetchAttributeImpl attr) { FieldMetaData field = meta.getDeclaredField(attr.name()); if (field == null || field.getManagement() != FieldMetaData.MANAGE_PERSISTENT) throw new MetaDataException(_loc.get("bad-fg-field", fg.getName(), meta, attr.name())); field.setInFetchGroup(fg.getName(), true); Set<String> parentFetchGroups = fg.getContainedBy(); for (Object parentFetchGroup : parentFetchGroups) field.setInFetchGroup(parentFetchGroup.toString(), true); if (attr.recursionDepth() != Integer.MIN_VALUE) fg.setRecursionDepth(field, attr.recursionDepth()); }
if (child == null) throw new UserException(_loc.get("missing-included-fg", meta.getDescribedType().getName(), fg.getName(), includedFectchGroupName)); child.addContainedBy(fg);