From ceb9c0fef2669388c302558f7d244530d302fb3a Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Wed, 22 Jun 2011 16:40:28 -0700 Subject: [PATCH] HHH-6352 : Add EntityBinding.getAttributeBindingClosureSpan() and getAttributeBindingClosure() --- .../metamodel/binding/EntityBinding.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/binding/EntityBinding.java b/hibernate-core/src/main/java/org/hibernate/metamodel/binding/EntityBinding.java index 89fc350133..f372291d07 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/binding/EntityBinding.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/binding/EntityBinding.java @@ -216,6 +216,32 @@ public class EntityBinding { return attributeBindingMap.get( name ); } + /** + * Gets the number of attribute bindings defined on this class, including the + * identifier attribute binding and attribute bindings defined + * as part of a join. + * + * @return The number of attribute bindings + */ + public int getAttributeBindingClosureSpan() { + // TODO: fix this after HHH-6337 is fixed. + // if this is not a root, then need to include the superclass attribute bindings + return attributeBindingMap.size(); + } + + /** + * Gets the attribute bindings defined on this class, including the + * identifier attribute binding and attribute bindings defined + * as part of a join. + * + * @return The attribute bindings. + */ + public Iterable getAttributeBindingClosure() { + // TODO: fix this after HHH-6337 is fixed. + // if this is not a root, then need to include the superclass attribute bindings + return getAttributeBindings(); + } + public Iterable getEntityReferencingAttributeBindings() { return entityReferencingAttributeBindings; }