This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enhanced Enhanced | |
allow_enhancement_as_proxy=true allow_enhancement_as_proxy=false Non-enhanced | |
Session#load: returns uninitialized, enhanced entity return enhanced entity that return entity | |
(entity/proxy (per HHH-11147) implements HibernateProxy that implements | |
not in PC HibernateProxy | |
yet) | |
LazyToOne: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.hibernate.service; | |
import java.util.Map; | |
import org.hibernate.SessionFactory; | |
import org.hibernate.boot.registry.StandardServiceRegistryBuilder; | |
import org.hibernate.cache.internal.RegionFactoryInitiator; | |
import org.hibernate.cache.spi.RegionFactory; | |
import org.hibernate.cfg.Configuration; | |
import org.hibernate.service.spi.ServiceContributor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task generateEnversStaticMetamodel(type: JavaCompile) { | |
source = sourceSets.main.java | |
include "org/hibernate/envers/**" | |
classpath = sourceSets.main.runtimeClasspath + sourceSets.test.compileClasspath | |
options.compilerArgs = [ | |
"-proc:only", | |
"-processor", | |
"org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor" | |
] | |
destinationDir = new File( "${projectDir}/src/main/java" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BytecodeInterceptorImpl implements BytecodeInterceptor { | |
private final Object interceptedEntity; | |
// "delegates" for the various interception capabilities. | |
private LazyAttributeInterceptionHandler lazyAttributeHandler; | |
private DirtinessTrackingInterceptionHandler dirtinessHandler; | |
private AssociationManagementInterceptionHandler associationHandler; | |
... | |
public BytecodeInterceptorImpl(Object interceptedEntity) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.liberologico.cloudesire.cmw.test.unit; | |
import org.hibernate.boot.MetadataSources; | |
import org.hibernate.boot.registry.StandardServiceRegistry; | |
import org.hibernate.boot.spi.MetadataImplementor; | |
import org.hibernate.cfg.AvailableSettings; | |
import org.hibernate.cfg.Configuration; | |
import org.hibernate.dialect.PostgreSQL94Dialect; | |
import org.hibernate.tool.hbm2ddl.SchemaUpdate; | |
import org.hibernate.tool.hbm2ddl.SchemaValidator; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void doCreation(Metadata metadata, boolean createNamespaces, Dialect dialect, Target... targets) | |
throws SchemaManagementException { | |
boolean tryToCreateCatalogs = false; | |
boolean tryToCreateSchemas = false; | |
if ( createNamespaces ) { | |
if ( dialect.canCreateCatalog() ) { | |
tryToCreateCatalogs = true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MetadataSources sources = new MetadataSources(...) | |
... | |
.addAnnotatedClasses( Item.class ); | |
.buildMetadata(); | |
MetadataSources sources = new MetadataSources(...) | |
... | |
.addAnnotatedClasses( Item.class ); | |
.usingContext() | |
.setNamingStrategy( new MyNamingStrategy() ) |