Skip to content

Instantly share code, notes, and snippets.

@gbadner
gbadner / gist:a9cb2b5547aeddf96c36cb6108e72403
Created April 29, 2019 22:16
Cases for HibernateProxy with enhancement
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:
@gbadner
gbadner / HHH-10478: OperationContext
Last active February 6, 2016 03:10
Overview of OperationContext design
Note: There are some details that need to be discussed. I will create a separate gist
for those details shortly.
POC: https://github.com/gbadner/hibernate-core/tree/HHH-10478-OperationContext
Design Overview
An OperationContext is intended to allow data important to an operation that is currently in progress,
that is needed in different areas of hibernate ORM code base. It allows data to be accessible without
having to pass it along as an argument from method to method to where it is needed.
@gbadner
gbadner / gist:8648491
Created January 27, 2014 13:22
"Integration" failures due to replacing org.hibernate.metamodel
org.hibernate.test.cid.CompositeIdWithGeneratorTest fails in master because new metamodel cannot handle an IdentityGenerator w/ more than one column. (was changed to IdentifierGenerator on metamodel branch).
org.hibernate.test.propertyref.basic.BasicPropertiesTest fails on master; not in metamodel branch.
Tests that extend BaseUnitTestCase (and not BaseCoreFunctionalTestCase) that explicitly build Configuration (requires merging changes to testing code from metamodel branch). For now, they throw NotYetImplementedException:
- org.hibernate.test.annotations.access.xml.XmlAccessTest
- org.hibernate.test.annotations.id.JoinColumnOverrideTest
- org.hibernate.test.annotations.id.sequences.JoinColumnOverrideTest
- org.hibernate.test.annotations.uniqueconstraint.UniqueConstraintValidationTest
- org.hibernate.test.cfg.cache.CacheConfigurationTest
- org.hibernate.test.nationalized.SimpleNationalizedTest
@gbadner
gbadner / gist:8406958
Created January 13, 2014 20:00
SelectGenerator diff
diff -r hibernate-core/src/main/java/org/hibernate/id/SelectGenerator.java ../hibernate-orm-metamodel-exact/hibernate-core/src/main/java/org/hibernate/id/SelectGenerator.java
26d25
<
37a37
> import org.hibernate.engine.spi.ValueInclusion;
84c84,85
< if ( persister.getEntityMetamodel().isNaturalIdentifierInsertGenerated() ) {
---
> ValueInclusion inclusion = persister.getPropertyInsertGenerationInclusions() [ naturalIdPropertyIndices[0] ];
> if ( inclusion != ValueInclusion.NONE ) {
@gbadner
gbadner / gist:8308553
Created January 7, 2014 23:03
Commits to o.h.metamodel in master branch (not in metamodel branch)
commit 8fe5460ec03942e974d4aae7d9060e20bab7f990
Author: Steve Ebersole <steve@hibernate.org>
Date: Sun Nov 24 20:07:37 2013 -0600
HHH-8741 - More checkstyle cleanups
commit cd590470c0059981537e558a5ff6d114fd24df61
Author: Steve Ebersole <steve@hibernate.org>
Date: Sun Nov 24 09:44:51 2013 -0600
@gbadner
gbadner / gist:8294930
Created January 7, 2014 05:19
EnumType conflict (HHH-7776)
<<<<<<< HEAD
public class EnumType implements EnhancedUserType, DynamicParameterizedType,LoggableUserType, Serializable {
=======
public class EnumType implements EnhancedUserType, DynamicParameterizedType, Serializable, StringRepresentableType {
>>>>>>> HHH-7776 - Consolidate to/from string handling for types in StringRepresentableType
private static final Logger LOG = Logger.getLogger( EnumType.class.getName() );
public static final String ENUM = "enumClass";
public static final String NAMED = "useNamed";
public static final String TYPE = "type";
@gbadner
gbadner / gist:8288905
Created January 6, 2014 20:02
BaseCoreFunctionalTestCase conflict
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@gbadner
gbadner / gist:8287045
Created January 6, 2014 18:18
ClassLoaderServiceImpl conflict
package org.hibernate.boot.registry.classloading.internal;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
@gbadner
gbadner / gist:8225496
Created January 2, 2014 19:53
HHH-7472 Index merge
public class Index extends AbstractConstraint implements Constraint {
protected Index(Table table, String name) {
super( table, name );
}
@Override
public String getExportIdentifier() {
StringBuilder sb = new StringBuilder( getTable().getLoggableValueQualifier());
sb.append( ".IDX" );
@gbadner
gbadner / gist:8103843
Created December 23, 2013 20:13
JdbcServicesImpl
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU