private String resolveRole(PluralAttribute attribute) { switch ( attribute.getDeclaringType().getPersistenceType() ) { case ENTITY: { return attribute.getDeclaringType().getJavaType().getName() + '.' + attribute.getName(); (MappedSuperclassType) attribute.getDeclaringType(), (EntityType) getPathSource().getModel() ); String.format( "Unexpected PersistenceType: [%s]", attribute.getDeclaringType().getPersistenceType()
private String [] createOriginalAndExpectedKeys(Attribute embeddedAttr, PluralAttribute listAttr) { String originalKey = embeddedAttr.getDeclaringType().getJavaType().getName() + "." + embeddedAttr.getName() + "." + listAttr.getName(); String copyKey = listAttr.getDeclaringType().getJavaType().getName() + "." + listAttr.getName(); String [] keys = { originalKey, copyKey }; return keys; }
private static String resolveRole(PluralAttribute attribute) { return attribute.getDeclaringType().getJavaType().getName() + '.' + attribute.getName(); }
public JPACollectionType(PluralAttribute<?,?,?> collection, SecureEntity secureEntity) { super(collection.getName(), collection.getJavaType(), collection.getElementType().getJavaType(), secureEntity); String relName = StringUtilities.singularize(collection.getName()); this.idsFieldDefinition = new FieldDefinition( relName + AdaptrexEntityType.COLLECTION_IDS_NAME, ExtTypeFormatter.AUTO ); String capName = StringUtilities.capitalize(getName()); Class<?> declaringClass = collection.getDeclaringType().getJavaType(); try { getter = declaringClass.getMethod("get" + capName); } catch (Exception e) {} if (getter == null) return; try { setter = declaringClass.getMethod("set" + capName, getter.getReturnType()); } catch (Exception e) {} }
/** * Gets a new path that represents the given multi-valued attribute from this path. */ public <E, C extends java.util.Collection<E>> Expression<C> get(PluralAttribute<X, C, E> coll) { if (getType() != coll.getDeclaringType()) { coll = (PluralAttribute)((ManagedType)getType()).getAttribute(coll.getName()); } return new PathImpl<X,C>(this, (Members.PluralAttributeImpl<? super X, C, E>)coll, coll.getJavaType()); }
/** * Gets a new path that represents the given multi-valued attribute from this path. */ public <E, C extends java.util.Collection<E>> Expression<C> get(PluralAttribute<X, C, E> coll) { if (getType() != coll.getDeclaringType()) { coll = (PluralAttribute)((ManagedType)getType()).getAttribute(coll.getName()); } return new PathImpl<X,C>(this, (Members.PluralAttributeImpl<? super X, C, E>)coll, coll.getJavaType()); }
/** * Gets a new path that represents the given multi-valued attribute from this path. */ public <E, C extends java.util.Collection<E>> Expression<C> get(PluralAttribute<X, C, E> coll) { if (getType() != coll.getDeclaringType()) { coll = (PluralAttribute)((ManagedType)getType()).getAttribute(coll.getName()); } return new PathImpl<X,C>(this, (Members.PluralAttributeImpl<? super X, C, E>)coll, coll.getJavaType()); }
/** * Gets a new path that represents the given multi-valued attribute from this path. */ public <E, C extends java.util.Collection<E>> Expression<C> get(PluralAttribute<X, C, E> coll) { if (getType() != coll.getDeclaringType()) { coll = (PluralAttribute)((ManagedType)getType()).getAttribute(coll.getName()); } return new PathImpl<X,C>(this, (Members.PluralAttributeImpl<? super X, C, E>)coll, coll.getJavaType()); }
List<String> pkFields = getPrimaryKeyAttributeNames((EntityType<?>) cd.getDeclaringType()); List<String> fkFields = getPrimaryKeyAttributeNames(elementEntityType); List<DataObjectAttributeRelationship> attributeRelationships = new ArrayList<DataObjectAttributeRelationship>();
jpaProvider.isBag((EntityType<?>) targetAttribute.getDeclaringType(), targetAttribute.getName()) || requiresBlacklistedNode(sizeArg) || aggregateFunctionContext;
&& (attribute.getPersistentAttributeType() == Attribute.PersistentAttributeType.ONE_TO_MANY || attribute.getPersistentAttributeType() == Attribute.PersistentAttributeType.MANY_TO_MANY)) { EntityType declaringType = (EntityType) ((PluralAttribute) attribute).getDeclaringType(); EntityType elementType = (EntityType) ((PluralAttribute) attribute).getElementType();
for (Map.Entry<DatabaseField, DatabaseField> keyRel : keyMap.entrySet()) { attributeRelationships.add(new DataObjectAttributeRelationshipImpl( getPropertyNameFromDatabaseColumnName(cd.getDeclaringType(), keyRel.getKey().getName()), getPropertyNameFromDatabaseColumnName(elementEntityType, keyRel.getValue().getName())));