} while ( ( SingularAttributePath.class.isInstance( parentPath ) ) ); final EntityType entityType; if ( singularAttribute.getDeclaringType().getPersistenceType() == Type.PersistenceType.ENTITY ) { entityType = (EntityType) singularAttribute.getDeclaringType(); else if ( singularAttribute.getDeclaringType().getPersistenceType() == Type.PersistenceType.MAPPED_SUPERCLASS ){ (MappedSuperclassType) singularAttribute.getDeclaringType(), (EntityType) parentPath.getModel() ); String.format( "Unexpected PersistenceType: [%s]", singularAttribute.getDeclaringType().getPersistenceType()
String original = ((SingularAttributePath) path).getAttribute().getDeclaringType().getJavaType().getName() + "." + ((SingularAttributePath) path).getAttribute().getName() + "." + piece; String copy = path.getJavaType().getName() + "." + piece; copyCollectionPersister(original, copy, ((CriteriaBuilderImpl) builder).getEntityManagerFactory().getSessionFactory());
public void applyIdClassAttributes(Set<SingularAttribute<? super X,?>> idClassAttributes) { for ( SingularAttribute<? super X,?> idClassAttribute : idClassAttributes ) { if ( AbstractIdentifiableType.this == idClassAttribute.getDeclaringType() ) { @SuppressWarnings({ "unchecked" }) SingularAttribute<X,?> declaredAttribute = ( SingularAttribute<X,?> ) idClassAttribute; addAttribute( declaredAttribute ); } } AbstractIdentifiableType.this.idClassAttributes = idClassAttributes; }
private boolean isEmbeddedIdPart(JoinNode baseNode, String field, SingularAttribute<?, ?> attr) { if (attr.getDeclaringType() instanceof EmbeddableType<?>) { ManagedType<?> managedType = baseNode.getManagedType(); if (managedType instanceof EntityType<?>) { int dotIndex = field.indexOf('.'); EntityType<?> entityType = (EntityType<?>) managedType; SingularAttribute<?, ?> potentialIdAttribute = entityType.getSingularAttribute(field.substring(0, dotIndex)); return potentialIdAttribute.isId(); } } return false; }
private boolean isEmbeddedIdPart(JoinNode baseNode, String field, SingularAttribute<?, ?> attr) { if (attr.getDeclaringType() instanceof EmbeddableType<?>) { ManagedType<?> managedType = baseNode.getManagedType(); if (managedType instanceof EntityType<?>) { int dotIndex = field.indexOf('.'); EntityType<?> entityType = (EntityType<?>) managedType; SingularAttribute<?, ?> potentialIdAttribute = entityType.getSingularAttribute(field.substring(0, dotIndex)); return potentialIdAttribute.isId(); } } return false; }
public JPAAssociationType(SingularAttribute<?,?> association, SecureEntity secureEntity) { super(association.getName(), association.getJavaType(), secureEntity); String associationName = association.getName(); this.idFieldDefinition = new FieldDefinition( associationName + AdaptrexEntityType.ENTITY_ID_NAME, ExtTypeFormatter.AUTO); String capName = StringUtilities.capitalize(getName()); Class<?> declaringClass = association.getDeclaringType().getJavaType(); try { getter = declaringClass.getMethod("get" + capName); } catch (Exception e) {} if (getter != null) { try { setter = declaringClass.getMethod("set" + capName, getter.getReturnType()); } catch (Exception e) {} } }
/** * Gets a new path that represents the given single-valued attribute from this path. */ public <Y> Path<Y> get(SingularAttribute<? super X, Y> attr) { if (getType() != attr.getDeclaringType()) { attr = (SingularAttribute)((ManagedType)getType()).getAttribute(attr.getName()); } return new PathImpl<X,Y>(this, (Members.SingularAttributeImpl<? super X, Y>)attr, attr.getJavaType()); }
/** * Gets a new path that represents the given single-valued attribute from this path. */ public <Y> Path<Y> get(SingularAttribute<? super X, Y> attr) { if (getType() != attr.getDeclaringType()) { attr = (SingularAttribute)((ManagedType)getType()).getAttribute(attr.getName()); } return new PathImpl<X,Y>(this, (Members.SingularAttributeImpl<? super X, Y>)attr, attr.getJavaType()); }
/** * Gets a new path that represents the given single-valued attribute from this path. */ public <Y> Path<Y> get(SingularAttribute<? super X, Y> attr) { if (getType() != attr.getDeclaringType()) { attr = (SingularAttribute)((ManagedType)getType()).getAttribute(attr.getName()); } return new PathImpl<X,Y>(this, (Members.SingularAttributeImpl<? super X, Y>)attr, attr.getJavaType()); }
/** * Gets a new path that represents the given single-valued attribute from this path. */ public <Y> Path<Y> get(SingularAttribute<? super X, Y> attr) { if (getType() != attr.getDeclaringType()) { attr = (SingularAttribute)((ManagedType)getType()).getAttribute(attr.getName()); } return new PathImpl<X,Y>(this, (Members.SingularAttributeImpl<? super X, Y>)attr, attr.getJavaType()); }
String parentFieldName = getPropertyNameFromDatabaseColumnName(rd.getDeclaringType(), parentDatabaseField.getName());