org.hibernate.mapping.IndexBackref Maven / Gradle / Ivy
                 Go to download
                
        
                    Show more of this group  Show more artifacts with this name
Show all versions of hibernate-core Show documentation
                Show all versions of hibernate-core Show documentation
The core O/RM functionality as provided by Hibernate
                
             The newest version!
        
        /*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.mapping;
import org.hibernate.MappingException;
import org.hibernate.property.access.internal.PropertyAccessStrategyIndexBackRefImpl;
import org.hibernate.property.access.spi.PropertyAccessStrategy;
/**
 * @author Gavin King
 */
public class IndexBackref extends Property {
	private String collectionRole;
	private String entityName;
	@Override
	public boolean isBackRef() {
		return true;
	}
	@Override
	public boolean isSynthetic() {
		return true;
	}
	public String getCollectionRole() {
		return collectionRole;
	}
	public void setCollectionRole(String collectionRole) {
		this.collectionRole = collectionRole;
	}
	@Override
	public boolean isBasicPropertyAccessor() {
		return false;
	}
	private PropertyAccessStrategy accessStrategy;
	@Override
	public PropertyAccessStrategy getPropertyAccessStrategy(Class clazz) throws MappingException {
		if ( accessStrategy == null ) {
			accessStrategy = new PropertyAccessStrategyIndexBackRefImpl( collectionRole, entityName );
		}
		return accessStrategy;
	}
	public String getEntityName() {
		return entityName;
	}
	public void setEntityName(String entityName) {
		this.entityName = entityName;
	}
}
     © 2015 - 2025 Weber Informatics LLC | Privacy Policy