Java Code Examples for org.hibernate.mapping.PersistentClass#isLazy()

The following examples show how to use org.hibernate.mapping.PersistentClass#isLazy() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HbmBinder.java    From cacheonix-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
private static void bindPojoRepresentation(Element node, PersistentClass entity,
		Mappings mappings, java.util.Map metaTags) {

	String className = getClassName( node.attribute( "name" ), mappings );
	String proxyName = getClassName( node.attribute( "proxy" ), mappings );

	entity.setClassName( className );

	if ( proxyName != null ) {
		entity.setProxyInterfaceName( proxyName );
		entity.setLazy( true );
	}
	else if ( entity.isLazy() ) {
		entity.setProxyInterfaceName( className );
	}

	Element tuplizer = locateTuplizerDefinition( node, EntityMode.POJO );
	if ( tuplizer != null ) {
		entity.addTuplizer( EntityMode.POJO, tuplizer.attributeValue( "class" ) );
	}
}
 
Example 2
Source File: ProxyDefinitions.java    From quarkus with Apache License 2.0 4 votes vote down vote up
private static boolean needsProxyGeneration(PersistentClass persistentClass) {
    //Only lazy entities need a proxy, and only class-mapped classed can be proxies (Envers!)
    return persistentClass.isLazy() && (persistentClass.getMappedClass() != null);
}