HHH-6201 javadoc
This commit is contained in:
parent
b14a514d73
commit
7b121038a1
|
@ -46,7 +46,7 @@ import org.hibernate.metamodel.source.hbm.xml.mapping.XMLSynchronizeElement;
|
||||||
import org.hibernate.metamodel.source.util.MappingHelper;
|
import org.hibernate.metamodel.source.util.MappingHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO : javadoc
|
* Provides the link between the domain and the relational model for an entity.
|
||||||
*
|
*
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
|
@ -58,9 +58,8 @@ public class EntityBinding {
|
||||||
private Entity entity;
|
private Entity entity;
|
||||||
private TableSpecification baseTable;
|
private TableSpecification baseTable;
|
||||||
|
|
||||||
private Map<String,AttributeBinding> attributeBindingMap = new HashMap<String, AttributeBinding>();
|
private Map<String, AttributeBinding> attributeBindingMap = new HashMap<String, AttributeBinding>();
|
||||||
private Set<EntityReferencingAttributeBinding> entityReferencingAttributeBindings =
|
private Set<EntityReferencingAttributeBinding> entityReferencingAttributeBindings = new HashSet<EntityReferencingAttributeBinding>();
|
||||||
new HashSet<EntityReferencingAttributeBinding>();
|
|
||||||
|
|
||||||
private Caching caching;
|
private Caching caching;
|
||||||
|
|
||||||
|
@ -126,9 +125,11 @@ public class EntityBinding {
|
||||||
try {
|
try {
|
||||||
entityPersisterClass = ReflectHelper.classForName( entityClazz.getPersister() );
|
entityPersisterClass = ReflectHelper.classForName( entityClazz.getPersister() );
|
||||||
}
|
}
|
||||||
catch (ClassNotFoundException cnfe) {
|
catch ( ClassNotFoundException cnfe ) {
|
||||||
throw new MappingException( "Could not find persister class: "
|
throw new MappingException(
|
||||||
+ entityClazz.getPersister() );
|
"Could not find persister class: "
|
||||||
|
+ entityClazz.getPersister()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +191,7 @@ public class EntityBinding {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void bindEntityIdentifier(SimpleAttributeBinding attributeBinding) {
|
public void bindEntityIdentifier(SimpleAttributeBinding attributeBinding) {
|
||||||
if ( ! Column.class.isInstance( attributeBinding.getValue() ) ) {
|
if ( !Column.class.isInstance( attributeBinding.getValue() ) ) {
|
||||||
throw new MappingException(
|
throw new MappingException(
|
||||||
"Identifier value must be a Column; instead it is: " + attributeBinding.getValue().getClass()
|
"Identifier value must be a Column; instead it is: " + attributeBinding.getValue().getClass()
|
||||||
);
|
);
|
||||||
|
@ -204,7 +205,7 @@ public class EntityBinding {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void bindEntityDiscriminator(SimpleAttributeBinding attributeBinding) {
|
public void bindEntityDiscriminator(SimpleAttributeBinding attributeBinding) {
|
||||||
if ( ! Column.class.isInstance( attributeBinding.getValue() ) ) {
|
if ( !Column.class.isInstance( attributeBinding.getValue() ) ) {
|
||||||
throw new MappingException(
|
throw new MappingException(
|
||||||
"Identifier value must be a Column; instead it is: " + attributeBinding.getValue().getClass()
|
"Identifier value must be a Column; instead it is: " + attributeBinding.getValue().getClass()
|
||||||
);
|
);
|
||||||
|
@ -231,7 +232,7 @@ public class EntityBinding {
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleAttributeBinding makeSimplePrimaryKeyAttributeBinding(String name) {
|
public SimpleAttributeBinding makeSimplePrimaryKeyAttributeBinding(String name) {
|
||||||
final SimpleAttributeBinding binding = makeSimpleAttributeBinding( name, true, true );
|
final SimpleAttributeBinding binding = makeSimpleAttributeBinding( name, true, true );
|
||||||
getEntityIdentifier().setValueBinding( binding );
|
getEntityIdentifier().setValueBinding( binding );
|
||||||
return binding;
|
return binding;
|
||||||
}
|
}
|
||||||
|
@ -241,23 +242,22 @@ public class EntityBinding {
|
||||||
// TODO: LOG this!!!
|
// TODO: LOG this!!!
|
||||||
}
|
}
|
||||||
entityDiscriminator = new EntityDiscriminator( this );
|
entityDiscriminator = new EntityDiscriminator( this );
|
||||||
entityDiscriminator.setValueBinding( makeSimpleAttributeBinding( name, true, false ) );
|
entityDiscriminator.setValueBinding( makeSimpleAttributeBinding( name, true, false ) );
|
||||||
return entityDiscriminator.getValueBinding();
|
return entityDiscriminator.getValueBinding();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleAttributeBinding makeVersionBinding(String name) {
|
public SimpleAttributeBinding makeVersionBinding(String name) {
|
||||||
versionBinding = makeSimpleAttributeBinding( name, true, false );
|
versionBinding = makeSimpleAttributeBinding( name, true, false );
|
||||||
return versionBinding;
|
return versionBinding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public SimpleAttributeBinding makeSimpleAttributeBinding(String name) {
|
public SimpleAttributeBinding makeSimpleAttributeBinding(String name) {
|
||||||
return makeSimpleAttributeBinding( name, false, false );
|
return makeSimpleAttributeBinding( name, false, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
private SimpleAttributeBinding makeSimpleAttributeBinding(String name, boolean forceNonNullable, boolean forceUnique) {
|
private SimpleAttributeBinding makeSimpleAttributeBinding(String name, boolean forceNonNullable, boolean forceUnique) {
|
||||||
final SimpleAttributeBinding binding = new SimpleAttributeBinding( this, forceNonNullable, forceUnique );
|
final SimpleAttributeBinding binding = new SimpleAttributeBinding( this, forceNonNullable, forceUnique );
|
||||||
registerAttributeBinding( name, binding );
|
registerAttributeBinding( name, binding );
|
||||||
binding.setAttribute( entity.getAttribute( name ) );
|
binding.setAttribute( entity.getAttribute( name ) );
|
||||||
return binding;
|
return binding;
|
||||||
|
|
Loading…
Reference in New Issue