HHH-6447 Formatting

This commit is contained in:
Hardy Ferentschik 2011-07-21 12:26:34 +02:00
parent 520db31a65
commit c069e6dada
6 changed files with 32 additions and 23 deletions

View File

@ -112,10 +112,15 @@ public class ConfiguredClass {
private final Map<String, SimpleAttribute> simpleAttributeMap; private final Map<String, SimpleAttribute> simpleAttributeMap;
/** /**
* The mapped simple attributes for this entity * The version attribute or {@code null} in case none exists.
*/ */
private SimpleAttribute versionAttribute; private SimpleAttribute versionAttribute;
/**
* The discriminator attribute or {@code null} in case none exists.
*/
private SimpleAttribute discriminatorAttribute;
/** /**
* The embedded classes for this entity * The embedded classes for this entity
*/ */
@ -187,6 +192,10 @@ public class ConfiguredClass {
return versionAttribute; return versionAttribute;
} }
public SimpleAttribute getDiscriminatorAttribute() {
return discriminatorAttribute;
}
public Iterable<AssociationAttribute> getAssociationAttributes() { public Iterable<AssociationAttribute> getAssociationAttributes() {
return associationAttributeMap.values(); return associationAttributeMap.values();
} }
@ -449,6 +458,9 @@ public class ConfiguredClass {
} else if (attribute.isVersioned()) { } else if (attribute.isVersioned()) {
// todo - error handling in case there are multiple version attributes // todo - error handling in case there are multiple version attributes
versionAttribute = attribute; versionAttribute = attribute;
} else if (attribute.isDiscriminator()) {
// todo - error handling in case there are multiple discriminator attributes
versionAttribute = attribute;
} }
else { else {
simpleAttributeMap.put( attributeName, attribute ); simpleAttributeMap.put( attributeName, attribute );

View File

@ -117,10 +117,6 @@ public class EntityClass extends ConfiguredClass {
return JandexHelper.getValue( jpaEntityAnnotation, "name", String.class ); return JandexHelper.getValue( jpaEntityAnnotation, "name", String.class );
} }
public InheritanceType getInheritanceType() {
return inheritanceType;
}
public IdType getIdType() { public IdType getIdType() {
return idType; return idType;
} }

View File

@ -75,7 +75,11 @@ public class RootEntitySourceImpl extends EntitySourceImpl implements RootEntity
@Override @Override
public SingularAttributeSource getDiscriminatorAttributeSource() { public SingularAttributeSource getDiscriminatorAttributeSource() {
return null; //To change body of implemented methods use File | Settings | File Templates. SingularAttributeSource attributeSource = null;
if ( getEntityClass().getDiscriminatorAttribute() != null ) {
attributeSource = new SingularAttributeSourceImpl( getEntityClass().getVersionAttribute() );
}
return attributeSource;
} }
@Override @Override

View File

@ -183,7 +183,4 @@ public interface EntitySource extends SubclassEntityContainer, AttributeSourceCo
* @return The meta-attribute sources. * @return The meta-attribute sources.
*/ */
public Iterable<MetaAttributeSource> metaAttributes(); public Iterable<MetaAttributeSource> metaAttributes();
// public List<XMLFetchProfileElement> getFetchProfile();
} }