public class

BackrefPropertyAccessor

extends Object
implements PropertyAccessor
java.lang.Object
   ↳ org.hibernate.property.BackrefPropertyAccessor

Class Overview

Represents a "back-reference" to the id of a collection owner. A "back-reference" is pertinent in mapping scenarios where we have a uni-directional one-to-many association in which only the many side is mapped. In this case it is the collection itself which is responsible for the FK value.

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.

Summary

Nested Classes
class BackrefPropertyAccessor.BackrefGetter Internal implementation of a property getter specific to these back-ref properties. 
class BackrefPropertyAccessor.BackrefSetter Internal implementation of a property setter specific to these back-ref properties. 
Fields
public static final Serializable UNKNOWN A placeholder for a property value, indicating that we don't know the value of the back reference
Public Constructors
BackrefPropertyAccessor(String collectionRole, String entityName)
Constructs a new instance of BackrefPropertyAccessor.
Public Methods
Getter getGetter(Class theClass, String propertyName)
Create a "getter" for the named attribute
Setter getSetter(Class theClass, String propertyName)
Create a "setter" for the named attribute
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.hibernate.property.PropertyAccessor

Fields

public static final Serializable UNKNOWN

A placeholder for a property value, indicating that we don't know the value of the back reference

Public Constructors

public BackrefPropertyAccessor (String collectionRole, String entityName)

Constructs a new instance of BackrefPropertyAccessor.

Parameters
collectionRole The collection role which this back ref references.
entityName The owner's entity name.

Public Methods

public Getter getGetter (Class theClass, String propertyName)

Create a "getter" for the named attribute

Parameters
theClass The class on which the property is defined.
propertyName The name of the property.
Returns
  • An appropriate getter.

public Setter getSetter (Class theClass, String propertyName)

Create a "setter" for the named attribute

Parameters
theClass The class on which the property is defined.
propertyName The name of the property.
Returns
  • An appropriate setter