In this scenario, the one side has no inherent knowledge of its "owner". So we introduce a synthetic property into the one side to represent the association; a so-called back-reference.
| Modifier and Type | Class and Description |
|---|---|
| public class | BackrefPropertyAccessor.BackrefGetter
Internal implementation of a property getter specific to these back-ref properties. |
| public static class | BackrefPropertyAccessor.BackrefSetter
Internal implementation of a property setter specific to these back-ref properties. |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final BackrefPropertyAccessor. | |
| private final String | |
| private final BackrefPropertyAccessor. | |
| public static final Serializable | UNKNOWN
A placeholder for a property value, indicating that we don't know the value of the back reference |
| Access | Constructor and Description |
|---|---|
| public | BackrefPropertyAccessor(String
The collection role which this back ref references. collectionRole, String The owner's entity name. entityName)Constructs a new instance of BackrefPropertyAccessor. |
| Modifier and Type | Method and Description |
|---|---|
| public Getter | getGetter(Class<T>
The class on which the property is defined. theClass, String The name of the property. propertyName)Implements org. |
| public Setter | getSetter(Class<T>
The class on which the property is defined. theClass, String The name of the property. propertyName)Implements org. |
| entityName | back to summary |
|---|---|
| private final String entityName | |
| getter | back to summary |
|---|---|
| private final BackrefPropertyAccessor. | |
| propertyName | back to summary |
|---|---|
| private final String propertyName | |
| setter | back to summary |
|---|---|
| private final BackrefPropertyAccessor. | |
| UNKNOWN | back to summary |
|---|---|
| public static final Serializable UNKNOWN A placeholder for a property value, indicating that we don't know the value of the back reference | |
| BackrefPropertyAccessor | back to summary |
|---|---|
| public BackrefPropertyAccessor(String collectionRole, String entityName) Constructs a new instance of BackrefPropertyAccessor. | |
| getGetter | back to summary |
|---|---|
| public Getter getGetter(Class<T> theClass, String propertyName) Implements org. Doc from org. Create a "getter" for the named attribute | |
| getSetter | back to summary |
|---|---|
| public Setter getSetter(Class<T> theClass, String propertyName) Implements org. Doc from org. Create a "setter" for the named attribute | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | get(Object
The instance containing the value to be retreived. target)Implements org. |
| public Object | getForInsert(Object
The instance containing the value to be retreived. target, Map<K, V> a map of merged persistent instances to detached instances mergeMap, SessionImplementor The session from which this request originated. session)Implements org. |
| public Member | getMember()
Implements org. |
| public Method | |
| public String | getMethodName()
Implements org. |
| public Class | getReturnType()
Implements org. |
| BackrefGetter | back to summary |
|---|---|
| public BackrefGetter() | |
| get | back to summary |
|---|---|
| public Object get(Object target) Implements org. Doc from org. Get the property value from the given instance . | |
| getForInsert | back to summary |
|---|---|
| public Object getForInsert(Object target, Map<K, V> mergeMap, SessionImplementor session) Implements org. Doc from org. Get the property value from the given owner instance.
| |
| getMember | back to summary |
|---|---|
| public Member getMember() Implements org. Doc from org. Retrieve the member to which this property maps. This might be the field or it might be the getter method.
| |
| getMethod | back to summary |
|---|---|
| public Method getMethod() Implements org. Doc from org. Retrieve the getter-method. Optional operation (return null)
| |
| getMethodName | back to summary |
|---|---|
| public String getMethodName() Implements org. Doc from org. Retrieve the getter-method name. Optional operation (return null)
| |
| getReturnType | back to summary |
|---|---|
| public Class Implements org. Doc from org. Retrieve the declared Java type
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Method | |
| public String | getMethodName()
Implements org. |
| public void | set(Object
The instance upon which to set the given value. target, Object The value to be set on the target. value, SessionFactoryImplementor The session factory from which this request originated. factory)Implements org. |
| BackrefSetter | back to summary |
|---|---|
| public BackrefSetter() | |
| getMethod | back to summary |
|---|---|
| public Method getMethod() Implements org. Doc from org. Optional operation (return null) | |
| getMethodName | back to summary |
|---|---|
| public String getMethodName() Implements org. Doc from org. Optional operation (return null) | |
| set | back to summary |
|---|---|
| public void set(Object target, Object value, SessionFactoryImplementor factory) Implements org. Doc from org. Set the property value from the given instance
| |