Skip to content

Instantly share code, notes, and snippets.

View sebersole's full-sized avatar

Steve Ebersole sebersole

View GitHub Profile
@sebersole
sebersole / code.java
Created April 5, 2016 18:53
Query#setParameter "extras"
/**
* Bind a positional String-valued parameter.
*
* @param position The parameter position
* @param val The bind value
*
* @return {@code this}, for method chaining
*/
Query setString(int position, String val);
@sebersole
sebersole / BytecodeInterceptorImpl.java
Last active November 13, 2015 16:36 — forked from barreiro/Experiment1.java
Discussion regarding design changes in bytecode enhancement
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) {
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;
- private Map columns = new LinkedHashMap();
+ private Map<Identifier,Column> columnByLogicalNameMap = new LinkedHashMap<Identifier,Column>();
+ private Map<Identifier,Column> columnByPhysicalNameMap = new LinkedHashMap<Identifier,Column>();
Index: hibernate-core/src/main/java/org/hibernate/mapping/Table.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- hibernate-core/src/main/java/org/hibernate/mapping/Table.java (date 1445457150000)
+++ hibernate-core/src/main/java/org/hibernate/mapping/Table.java (revision )
@@ -12,7 +12,6 @@
import java.util.Iterator;
import java.util.LinkedHashMap;
- private int length = DEFAULT_LENGTH;
- private int precision = DEFAULT_PRECISION;
- private int scale = DEFAULT_SCALE;
- private Value value;
- private int typeIndex;
- private String name;
+ private Identifier logicalName;
+ private Identifier physicalName;
+
Index: hibernate-core/src/main/java/org/hibernate/mapping/Column.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- hibernate-core/src/main/java/org/hibernate/mapping/Column.java (date 1445457150000)
+++ hibernate-core/src/main/java/org/hibernate/mapping/Column.java (revision )
@@ -9,11 +9,11 @@
import java.io.Serializable;
import java.util.Locale;
task assembleDocumentation(type: Task, dependsOn: [rootProject.project( 'documentation' ).tasks.buildDocs]) {
description = 'Assembles all documentation into the {buildDir}/documentation directory'
doLast {
// copy documentation outputs into target/documentation.
// * this is used in building the dist bundles
// * it is also used as a base to build a staged directory for documentation upload
copy {
from "${rootProject.project( 'documentation' ).buildDir}/docbook/publish"
for ( Entry<Object, EntityEntry> objectEntityEntryEntry : entityEntryContext.reentrantSafeEntityEntries() ) {
// todo : I dont think this need be reentrant safe
if ( objectEntityEntryEntry.getKey() instanceof PersistentAttributeInterceptable ) {
final PersistentAttributeInterceptor interceptor = ( (PersistentAttributeInterceptable) objectEntityEntryEntry.getKey() ).$$_hibernate_getInterceptor();
if ( interceptor instanceof LazyAttributeLoader ) {
( (LazyAttributeLoader) interceptor ).unsetSession();
}
}
}
java.lang.AssertionError
at org.junit.Assert.fail(Assert.java:86)
at org.junit.Assert.assertTrue(Assert.java:41)
at org.junit.Assert.assertFalse(Assert.java:64)
at org.junit.Assert.assertFalse(Assert.java:74)
at org.hibernate.test.bytecode.enhancement.ondemandload.LazyCollectionWithClearedSessionTestTask.execute(LazyCollectionWithClearedSessionTestTask.java:60)
at org.hibernate.test.bytecode.enhancement.EnhancerTestUtils.runEnhancerTestTask(EnhancerTestUtils.java:99)
at org.hibernate.test.bytecode.enhancement.EnhancerTest.testOnDemand(EnhancerTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)