public EntityFetchGroup(String attributeName) { super(); super.addAttribute(attributeName, (AttributeGroup)null); }
public EntityFetchGroup(String[] attributeNames) { super(); for(int i=0; i < attributeNames.length; i++) { super.addAttribute(attributeNames[i], (AttributeGroup)null); } }
public EntityFetchGroup(String[] attributeNames) { super(); for(int i=0; i < attributeNames.length; i++) { super.addAttribute(attributeNames[i], (AttributeGroup)null); } }
@Override public void addAttribute(String attributeNameOrPath, Collection<? extends CoreAttributeGroup> groups) { wrappedFetchGroup.addAttribute(attributeNameOrPath, groups); }
public EntityFetchGroup(String attributeName) { super(); super.addAttribute(attributeName, (AttributeGroup)null); }
@Override public void addAttribute(String attributeNameOrPath, CoreAttributeGroup group) { wrappedFetchGroup.addAttribute(attributeNameOrPath, group); }
@Override public void addAttribute(String attributeNameOrPath, AttributeGroup group) { wrappedFetchGroup.addAttribute(attributeNameOrPath, group); }
@Override public void addAttribute(String attributeNameOrPath) { wrappedFetchGroup.addAttribute(attributeNameOrPath); }
public EntityFetchGroup(Collection<String> attributeNames) { super(); Iterator<String> it = attributeNames.iterator(); while(it.hasNext()) { super.addAttribute(it.next(), (AttributeGroup)null); } }
public EntityFetchGroup(Collection<String> attributeNames) { super(); Iterator<String> it = attributeNames.iterator(); while(it.hasNext()) { super.addAttribute(it.next(), (AttributeGroup)null); } }
public EntityFetchGroup(FetchGroup fetchGroup, String attributeName) { super(fetchGroup.getName() + "+" + attributeName); if(fetchGroup.hasItems()) { Iterator<String> it = fetchGroup.getItems().keySet().iterator(); while(it.hasNext()) { super.addAttribute(it.next(), (AttributeGroup)null); } } super.addAttribute(attributeName, (AttributeGroup)null); }
public EntityFetchGroup(FetchGroup fetchGroup, String attributeName) { super(fetchGroup.getName() + "+" + attributeName); if(fetchGroup.hasItems()) { Iterator<String> it = fetchGroup.getItems().keySet().iterator(); while(it.hasNext()) { super.addAttribute(it.next(), (AttributeGroup)null); } } super.addAttribute(attributeName, (AttributeGroup)null); }
public EntityFetchGroup(FetchGroup fetchGroup) { super(fetchGroup.getName()); if(fetchGroup.hasItems()) { Iterator<String> it = fetchGroup.getItems().keySet().iterator(); while(it.hasNext()) { super.addAttribute(it.next(), (AttributeGroup)null); } } }
public EntityFetchGroup(FetchGroup fetchGroup) { super(fetchGroup.getName()); if(fetchGroup.hasItems()) { Iterator<String> it = fetchGroup.getItems().keySet().iterator(); while(it.hasNext()) { super.addAttribute(it.next(), (AttributeGroup)null); } } }
/** * INTERNAL: * Add primary key and version attributes to the passed fetch group. */ public void addMinimalFetchGroup(FetchGroup fetchGroup) { if (this.minimalFetchGroup == null) { return; } Iterator<String> it = this.minimalFetchGroup.getAttributeNames().iterator(); while(it.hasNext()) { String name = it.next(); if(!fetchGroup.containsAttribute(name)) { fetchGroup.addAttribute(name); } } }
/** * INTERNAL: * Add primary key and version attributes to the passed fetch group. */ public void addMinimalFetchGroup(FetchGroup fetchGroup) { if (this.minimalFetchGroup == null) { return; } Iterator<String> it = this.minimalFetchGroup.getAttributeNames().iterator(); while(it.hasNext()) { String name = it.next(); if(!fetchGroup.containsAttribute(name)) { fetchGroup.addAttribute(name); } } }
protected Object constructObjectForId(String entityType, Object id){ FetchGroup fetchGroup = new FetchGroup(); ClassDescriptor descriptor = context.getDescriptor(entityType); List<DatabaseMapping> pkMappings = descriptor.getObjectBuilder().getPrimaryKeyMappings(); for (DatabaseMapping mapping: pkMappings){ fetchGroup.addAttribute(mapping.getAttributeName()); } Map<String, Object> properties = new HashMap<String, Object>(); properties.put(QueryHints.FETCH_GROUP, fetchGroup); properties.put(QueryHints.CACHE_USAGE, CacheUsage.CheckCacheOnly); Object entity = context.find(null, entityType, id, properties); if (entity == null){ return IdHelper.buildObjectShell(context, entityType, id); } return entity; }
DatabaseQuery applyToDatabaseQuery(Object valueToApply, DatabaseQuery query, ClassLoader loader, AbstractSession activeSession) { if (query.isObjectLevelReadQuery()) { FetchGroup fetchGroup = ((ObjectLevelReadQuery)query).getFetchGroup(); if (fetchGroup == null) { fetchGroup = new FetchGroup(); ((ObjectLevelReadQuery)query).setFetchGroup(fetchGroup); } fetchGroup.addAttribute((String)valueToApply); } else { throw new IllegalArgumentException(ExceptionLocalization.buildMessage("ejb30-wrong-type-for-query-hint",new Object[]{getQueryId(query), name, getPrintValue(valueToApply)})); } return query; } }
protected void initNonReferenceEntityFetchGroup() { FetchGroup nonReferenceFetchGroup = new FetchGroup(); for (DatabaseMapping mapping : getDescriptor().getMappings()) { if(!mapping.isForeignReferenceMapping()) { String name = mapping.getAttributeName(); if(this.defaultEntityFetchGroup == null || this.defaultEntityFetchGroup.containsAttribute(name)) { nonReferenceFetchGroup.addAttribute(name); } } } this.addMinimalFetchGroup(nonReferenceFetchGroup); this.nonReferenceEntityFetchGroup = getEntityFetchGroup(nonReferenceFetchGroup); }
protected void initNonReferenceEntityFetchGroup() { FetchGroup nonReferenceFetchGroup = new FetchGroup(); for (DatabaseMapping mapping : getDescriptor().getMappings()) { if(!mapping.isForeignReferenceMapping()) { String name = mapping.getAttributeName(); if(this.defaultEntityFetchGroup == null || this.defaultEntityFetchGroup.containsAttribute(name)) { nonReferenceFetchGroup.addAttribute(name); } } } this.addMinimalFetchGroup(nonReferenceFetchGroup); this.nonReferenceEntityFetchGroup = getEntityFetchGroup(nonReferenceFetchGroup); }