Move annotations, bytecode, cache, cascade, cdi, cfg, cid, component, compositeelement, customstructures, deletetransient, dialect, dirtyness, entitymode, exceptionhandling, extendshbm, fetchprofiles, fetchstrategyhelper, flush, foreignkey, generatedkeys, hbm, hql, jpa, mapping packages.

This commit is contained in:
Christian Beikov 2021-05-20 17:05:20 +02:00 committed by Andrea Boriero
parent fe3b6690c1
commit db6701cc93
445 changed files with 1022 additions and 1021 deletions

View File

@ -19,7 +19,6 @@ import org.hibernate.dialect.DerbyDialect;
import org.hibernate.testing.orm.junit.EntityManagerFactoryScope;
import org.hibernate.testing.orm.junit.Jpa;
import org.hibernate.testing.orm.junit.NotImplementedYet;
import org.hibernate.testing.orm.junit.SkipForDialect;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
@ -102,10 +101,6 @@ public class SubselectTest {
}
@Test
@NotImplementedYet(
reason = "Refreshing a managed-entity does not work - https://trello.com/c/QAKC08JT/230-refresh-does-not-work-with-managed-entity-the-state-is-not-refreshed",
strict = false
)
public void testRefreshLifecycle(EntityManagerFactoryScope scope) {
//tag::mapping-Subselect-entity-find-example[]
scope.inTransaction(

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.CascadeType;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.io.Serializable;
import javax.persistence.Embeddable;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.math.BigDecimal;
import java.util.Map;
@ -16,8 +16,6 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.annotations.CascadeType;
@Entity
public class ExchangeOffice {

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.FetchType;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.Entity;
import javax.persistence.Id;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.Embeddable;
/**

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.Entity;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.math.BigDecimal;
import java.util.ArrayList;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import org.junit.Test;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.Entity;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.CascadeType;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.io.Serializable;
import javax.persistence.Embeddable;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.Column;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.Entity;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.util.SortedMap;
import java.util.TreeMap;
import javax.persistence.Entity;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.indexcoll;
package org.hibernate.orm.test.annotations.indexcoll;
import java.util.List;
import javax.persistence.CascadeType;

View File

@ -28,8 +28,8 @@ import javax.persistence.MapKeyJoinColumns;
import javax.persistence.MapKeyTemporal;
import javax.persistence.TemporalType;
import org.hibernate.test.annotations.indexcoll.Gas;
import org.hibernate.test.annotations.indexcoll.GasKey;
import org.hibernate.orm.test.annotations.indexcoll.Gas;
import org.hibernate.orm.test.annotations.indexcoll.GasKey;
/**
* @author Emmanuel Bernard

View File

@ -16,8 +16,8 @@ import org.hibernate.mapping.Collection;
import org.hibernate.mapping.Column;
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
import org.hibernate.test.annotations.indexcoll.Gas;
import org.hibernate.test.annotations.indexcoll.GasKey;
import org.hibernate.orm.test.annotations.indexcoll.Gas;
import org.hibernate.orm.test.annotations.indexcoll.GasKey;
import org.junit.Test;
import static org.junit.Assert.assertEquals;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.naturalid;
package org.hibernate.orm.test.annotations.naturalid;
import java.util.HashSet;
import java.util.Set;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.naturalid;
package org.hibernate.orm.test.annotations.naturalid;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.naturalid;
package org.hibernate.orm.test.annotations.naturalid;
import javax.persistence.Entity;
import javax.persistence.FetchType;

View File

@ -4,12 +4,11 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.naturalid;
package org.hibernate.orm.test.annotations.naturalid;
import javax.persistence.FlushModeType;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.JoinType;
import javax.persistence.criteria.Root;
import org.junit.Assert;
@ -19,6 +18,10 @@ import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.graph.GraphSemantic;
import org.hibernate.graph.RootGraph;
import org.hibernate.graph.spi.RootGraphImplementor;
import org.hibernate.query.Query;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -41,7 +44,7 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
newTx.commit();
newTx = s.beginTransaction();
getQuery( s ).uniqueResult(); // put query-result into cache
fetchA( s ); // put query-result into cache
A a2 = new A();
a2.setName( "xxxxxx" );
s.persist( a2 );
@ -56,7 +59,7 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
Assert.assertTrue( s.getSessionFactory().getStatistics().isStatisticsEnabled() );
s.getSessionFactory().getStatistics().clear();
getQuery( s ).uniqueResult(); // should produce a hit in StandardQuery cache region
fetchA( s ); // should produce a hit in StandardQuery cache region
Assert.assertEquals(
"query is not considered as isImmutableNaturalKeyLookup, despite fullfilling all conditions",
@ -91,8 +94,8 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
Query<A> query = session.createQuery( criteria );
query.setFlushMode( FlushModeType.COMMIT );
query.setCacheable( true );
query.uniqueResult();
// getCriteria( s ).add( Restrictions.isNull( "singleD" ) ).uniqueResult(); // put query-result into cache
query.uniqueResult(); // put query-result into cache
A a2 = new A();
a2.setName( "xxxxxx" );
s.persist( a2 );
@ -112,7 +115,6 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
query.setFlushMode( FlushModeType.COMMIT );
query.setCacheable( true );
query.uniqueResult();
// getCriteria( s ).add( Restrictions.isNull( "singleD" ) ).uniqueResult();
Assert.assertEquals( 0, s.getSessionFactory().getStatistics().getQueryCacheHitCount() );
@ -140,8 +142,8 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
newTx = s.beginTransaction();
getQueryFecth( s, "ds", JoinType.LEFT ).uniqueResult();
// getQuery( s ).setFetchMode( "ds", FetchMode.JOIN ).uniqueResult(); // put query-result into cache
fetchA( s, "ds" ); // put query-result into cache
A a2 = new A();
a2.setName( "xxxxxx" );
s.persist( a2 );
@ -164,8 +166,7 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
s.getSessionFactory().getStatistics().clear();
// should produce a hit in StandardQuery cache region
getQueryFecth( s, "ds", JoinType.LEFT ).uniqueResult();
// getCriteria( s ).setFetchMode( "ds", FetchMode.JOIN ).uniqueResult();
fetchA( s, "ds" );
Assert.assertEquals(
"query is not considered as isImmutableNaturalKeyLookup, despite fullfilling all conditions",
@ -196,8 +197,8 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
newTx.commit();
newTx = s.beginTransaction();
getQueryFecth( s, "singleD" , JoinType.LEFT).uniqueResult();
// getCriteria( s ).setFetchMode( "singleD", FetchMode.JOIN ).uniqueResult(); // put query-result into cache
fetchA( s, "singleD" ); // put query-result into cache
A a2 = new A();
a2.setName( "xxxxxx" );
s.persist( a2 );
@ -213,8 +214,7 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
s.getSessionFactory().getStatistics().clear();
// should produce a hit in StandardQuery cache region
getQueryFecth( s, "singleD", JoinType.LEFT ).uniqueResult();
// getCriteria( s ).setFetchMode( "singleD", FetchMode.JOIN ).uniqueResult();
fetchA( s, "singleD" );
Assert.assertEquals(
"query is not considered as isImmutableNaturalKeyLookup, despite fullfilling all conditions",
@ -245,9 +245,8 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
newTx.commit();
newTx = s.beginTransaction();
getQueryFecth( s, "singleD", JoinType.LEFT).uniqueResult();
// getCriteria( s ).createAlias( "singleD", "d", JoinType.LEFT_OUTER_JOIN )
// .uniqueResult(); // put query-result into cache
fetchA( s, "singleD" ); // put query-result into cache
A a2 = new A();
a2.setName( "xxxxxx" );
s.persist( a2 );
@ -266,8 +265,7 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
s.getSessionFactory().getStatistics().clear();
// should not produce a hit in StandardQuery cache region because createAlias() creates a subcriteria
getQueryFecth( s, "singleD", JoinType.LEFT).uniqueResult();
// getCriteria( s ).createAlias( "singleD", "d", JoinType.LEFT_OUTER_JOIN ).uniqueResult();
fetchA( s, "singleD" );
Assert.assertEquals( 0, s.getSessionFactory().getStatistics().getQueryCacheHitCount() );
s.createQuery( "delete from A" ).executeUpdate();
@ -295,10 +293,8 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
newTx.commit();
newTx = s.beginTransaction();
getQueryFecth( s, "singleD", JoinType.LEFT).uniqueResult();
fetchA( s, "singleD" ); // put query-result into cache
// getCriteria( s ).createCriteria( "singleD", "d", JoinType.LEFT_OUTER_JOIN )
// .uniqueResult(); // put query-result into cache
A a2 = new A();
a2.setName( "xxxxxx" );
s.persist( a2 );
@ -317,9 +313,7 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
s.getSessionFactory().getStatistics().clear();
// should not produce a hit in StandardQuery cache region because createCriteria() creates a subcriteria
getQueryFecth( s, "singleD", JoinType.LEFT).uniqueResult();
// getCriteria( s ).createCriteria( "singleD", "d", JoinType.LEFT_OUTER_JOIN ).uniqueResult();
fetchA( s, "singleD" );
Assert.assertEquals( 0, s.getSessionFactory().getStatistics().getQueryCacheHitCount() );
s.createQuery( "delete from A" ).executeUpdate();
@ -330,40 +324,25 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
s.close();
}
private Query<A> getQuery(Session s) {
CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder();
CriteriaQuery<A> criteria = criteriaBuilder.createQuery( A.class );
Root<A> root = criteria.from( A.class );
criteria.where( criteriaBuilder.equal( root.get( "name" ), "name1" ) );
Query<A> query = session.createQuery( criteria );
query.setFlushMode( FlushModeType.COMMIT );
query.setCacheable( true );
return query;
private A fetchA(Session s) {
return s.byNaturalId( A.class )
.using( "name", "name1" )
.load();
}
private Query<A> getQueryFecth(Session s, String fecth, JoinType joinType) {
CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder();
CriteriaQuery<A> criteria = criteriaBuilder.createQuery( A.class );
Root<A> root = criteria.from( A.class );
root.fetch( fecth, joinType );
criteria.where( criteriaBuilder.equal( root.get( "name" ), "name1" ) );
Query<A> query = session.createQuery( criteria );
query.setFlushMode( FlushModeType.COMMIT );
query.setCacheable( true );
return query;
private A fetchA(Session s, String fetch) {
final RootGraph<A> entityGraph = s.createEntityGraph( A.class );
entityGraph.addAttributeNodes( fetch );
( (SharedSessionContractImplementor) s ).getLoadQueryInfluencers()
.getEffectiveEntityGraph()
.applyGraph( (RootGraphImplementor<?>) entityGraph, GraphSemantic.LOAD );
final A a = s.byNaturalId( A.class )
.using( "name", "name1" )
.load();
((SharedSessionContractImplementor) s).getLoadQueryInfluencers().getEffectiveEntityGraph().clear();
return a;
}
// private CriteriaQuery getCriteria(Session s) {
// Criteria crit = s.createCriteria( A.class, "anAlias" );
// crit.add( Restrictions.naturalId().set( "name", "name1" ) );
// crit.setFlushMode( FlushMode.COMMIT );
// crit.setCacheable( true );
// return crit;
// }
@Override
protected Class[] getAnnotatedClasses() {
return new Class[] {

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.naturalid;
package org.hibernate.orm.test.annotations.naturalid;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.naturalid;
package org.hibernate.orm.test.annotations.naturalid;
import java.util.List;
@ -68,9 +68,9 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
Session s = openSession();
Transaction tx = s.beginTransaction();
State france = this.getState( s, "Ile de France" );
Criteria criteria = s.createCriteria( Citizen.class );
criteria.add( Restrictions.naturalId().set( "ssn", "1234" ).set( "state", france ) );
criteria.setCacheable( true );
NaturalIdLoadAccess<Citizen> loadAccess = s.byNaturalId( Citizen.class )
.using( "ssn", "1234" )
.using("state", france );
this.cleanupCache();
@ -81,15 +81,14 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
assertEquals( "Cache puts should be empty", 0, stats.getNaturalIdCachePutCount() );
// first query
List results = criteria.list();
assertEquals( 1, results.size() );
assertNotNull( loadAccess.load() );
assertEquals( "NaturalId Cache Hits", 0, stats.getNaturalIdCacheHitCount() );
assertEquals( "NaturalId Cache Misses", 1, stats.getNaturalIdCacheMissCount() );
assertEquals( "NaturalId Cache Puts", 1, stats.getNaturalIdCachePutCount() );
assertEquals( "NaturalId Cache Queries", 1, stats.getNaturalIdQueryExecutionCount() );
// query a second time - result should be cached in session
criteria.list();
loadAccess.load();
assertEquals( "NaturalId Cache Hits", 0, stats.getNaturalIdCacheHitCount() );
assertEquals( "NaturalId Cache Misses", 1, stats.getNaturalIdCacheMissCount() );
assertEquals( "NaturalId Cache Puts", 1, stats.getNaturalIdCachePutCount() );
@ -107,7 +106,7 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
Session s = openSession();
Transaction tx = s.beginTransaction();
State france = this.getState( s, "Ile de France" );
final NaturalIdLoadAccess naturalIdLoader = s.byNaturalId( Citizen.class );
final NaturalIdLoadAccess<Citizen> naturalIdLoader = s.byNaturalId( Citizen.class );
naturalIdLoader.using( "ssn", "1234" ).using( "state", france );
//NaturalId cache gets populated during entity loading, need to clear it out
@ -121,7 +120,7 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
assertEquals( "NaturalId Cache Queries", 0, stats.getNaturalIdQueryExecutionCount() );
// first query
Citizen citizen = (Citizen)naturalIdLoader.load();
Citizen citizen = naturalIdLoader.load();
assertNotNull( citizen );
assertEquals( "NaturalId Cache Hits", 0, stats.getNaturalIdCacheHitCount() );
assertEquals( "NaturalId Cache Misses", 1, stats.getNaturalIdCacheMissCount() );
@ -230,14 +229,8 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
Session s = openSession();
Transaction tx = s.beginTransaction();
State france = this.getState( s, "Ile de France" );
Criteria criteria = s.createCriteria( Citizen.class );
criteria.add(
Restrictions.naturalId().set( "ssn", "1234" ).set(
"state",
france
)
);
criteria.setCacheable( false );
final NaturalIdLoadAccess<Citizen> naturalIdLoader = s.byNaturalId( Citizen.class );
naturalIdLoader.using( "ssn", "1234" ).using( "state", france );
this.cleanupCache();
@ -250,8 +243,8 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
);
// first query
List results = criteria.list();
assertEquals( 1, results.size() );
Citizen citizen = naturalIdLoader.load();
assertNotNull( citizen );
assertEquals(
"Cache hits should be empty", 0, stats
.getNaturalIdCacheHitCount()
@ -262,7 +255,7 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
);
// query a second time - result should be cached in session
criteria.list();
naturalIdLoader.load();
assertEquals(
"Cache hits should be empty", 0, stats
.getNaturalIdCacheHitCount()

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.naturalid;
package org.hibernate.orm.test.annotations.naturalid;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.naturalid.cid;
package org.hibernate.orm.test.annotations.naturalid.cid;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.naturalid.cid;
package org.hibernate.orm.test.annotations.naturalid.cid;
import javax.persistence.Embeddable;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.naturalid.cid;
package org.hibernate.orm.test.annotations.naturalid.cid;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.util.ArrayList;
import javax.persistence.CascadeType;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.*;
import java.io.Serializable;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.util.ArrayList;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.util.ArrayList;
import java.util.List;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.io.Serializable;
import java.util.ArrayList;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;

View File

@ -6,11 +6,10 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.Entity;
import javax.persistence.PrimaryKeyJoinColumn;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.util.Arrays;
import java.util.Iterator;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.*;
import java.util.ArrayList;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.util.ArrayList;
import java.util.List;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.io.Serializable;
import javax.persistence.Column;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.util.HashSet;
import java.util.Set;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.util.ArrayList;
import java.util.Collection;
@ -567,7 +567,7 @@ public class OneToManyTest extends BaseNonConfigCoreFunctionalTestCase {
@Override
protected String[] getXmlFiles() {
return new String[] { "org/hibernate/test/annotations/onetomany/orm.xml" };
return new String[] { "org/hibernate/orm/test/annotations/onetomany/orm.xml" };
}
@Entity(name = "OnDeleteUnidirectionalOneToManyParent")

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@ -26,14 +26,15 @@ import org.hibernate.cfg.AvailableSettings;
import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.SQLServer2008Dialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.graph.RootGraph;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.collection.QueryableCollection;
import org.hibernate.query.Query;
import org.hibernate.sql.SimpleSelect;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -84,7 +85,7 @@ public class OrderByTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue(jiraKey = "HHH-465")
@RequiresDialect(value = { H2Dialect.class, MySQLDialect.class, SQLServer2008Dialect.class },
@RequiresDialect(value = { H2Dialect.class, MySQLDialect.class, SQLServerDialect.class },
comment = "By default H2 places NULL values first, so testing 'NULLS LAST' expression. " +
"For MySQL and SQL Server 2008 testing overridden Dialect#renderOrderByElement(String, String, String, NullPrecedence) method. " +
"MySQL and SQLServer 2008 does not support NULLS FIRST / LAST syntax at the moment, so transforming the expression to 'CASE WHEN ...'.")
@ -145,7 +146,7 @@ public class OrderByTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue(jiraKey = "HHH-465")
@RequiresDialect(value = { H2Dialect.class, MySQLDialect.class, SQLServer2008Dialect.class },
@RequiresDialect(value = { H2Dialect.class, MySQLDialect.class, SQLServerDialect.class },
comment = "By default H2 places NULL values first, so testing 'NULLS LAST' expression. " +
"For MySQL and SQL Server 2008 testing overridden Dialect#renderOrderByElement(String, String, String, NullPrecedence) method. " +
"MySQL and SQL Server 2008 does not support NULLS FIRST / LAST syntax at the moment, so transforming the expression to 'CASE WHEN ...'.")
@ -174,9 +175,9 @@ public class OrderByTest extends BaseCoreFunctionalTestCase {
zoo = (Zoo) session.get( Zoo.class, zoo.getId() );
Iterator<Visitor> iterator = zoo.getVisitors().iterator();
Assert.assertEquals( 3, zoo.getVisitors().size() );
Assert.assertEquals( visitor3, iterator.next() );
Assert.assertEquals( visitor2, iterator.next() );
Assert.assertEquals( visitor1, iterator.next() );
assertEquals( visitor3, iterator.next() );
assertEquals( visitor2, iterator.next() );
assertEquals( visitor1, iterator.next() );
session.getTransaction().commit();
session.clear();
@ -194,7 +195,7 @@ public class OrderByTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue(jiraKey = "HHH-465")
@RequiresDialect(value = { H2Dialect.class, MySQLDialect.class, SQLServer2008Dialect.class },
@RequiresDialect(value = { H2Dialect.class, MySQLDialect.class, SQLServerDialect.class },
comment = "By default H2 places NULL values first, so testing 'NULLS LAST' expression. " +
"For MySQL and SQL Server 2008 testing overridden Dialect#renderOrderByElement(String, String, String, NullPrecedence) method. " +
"MySQL and SQL Server 2008 does not support NULLS FIRST / LAST syntax at the moment, so transforming the expression to 'CASE WHEN ...'.")
@ -229,7 +230,7 @@ public class OrderByTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue( jiraKey = "HHH-7608" )
@RequiresDialect({ H2Dialect.class, Oracle8iDialect.class })
@RequiresDialect({ H2Dialect.class, OracleDialect.class })
public void testOrderByReferencingFormulaColumn() {
Session session = openSession();
@ -481,7 +482,7 @@ public class OrderByTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue( jiraKey = "HHH-14148" )
@RequiresDialect(value = { H2Dialect.class, MySQLDialect.class, SQLServer2008Dialect.class },
@RequiresDialect(value = { H2Dialect.class, MySQLDialect.class, SQLServerDialect.class },
comment = "By default H2 places NULL values first, so testing 'NULLS LAST' expression. " +
"For MySQL and SQL Server 2008 testing overridden Dialect#renderOrderByElement(String, String, String, NullPrecedence) method. " +
"MySQL and SQL Server 2008 does not support NULLS FIRST / LAST syntax at the moment, so transforming the expression to 'CASE WHEN ...'.")

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.io.Serializable;
import javax.persistence.Column;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.io.Serializable;
import javax.persistence.Column;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.CascadeType;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Column;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.io.Serializable;
import javax.persistence.Embeddable;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.util.ArrayList;
import java.util.List;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.CascadeType;
import javax.persistence.Entity;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import javax.persistence.Column;
import javax.persistence.Entity;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.io.Serializable;
import javax.persistence.Entity;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetomany;
package org.hibernate.orm.test.annotations.onetomany;
import java.io.Serializable;
import java.util.HashSet;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.CascadeType;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import java.io.Serializable;
import javax.persistence.Embeddable;

View File

@ -7,7 +7,7 @@
// $Id$
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
/**

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import javax.persistence.Entity;
import javax.persistence.Id;

View File

@ -11,7 +11,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import java.io.File;
import java.io.IOException;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import java.util.Iterator;
@ -443,7 +443,7 @@ public class OneToOneTest extends BaseNonConfigCoreFunctionalTestCase {
@Override
protected String[] getXmlFiles() {
return new String[] { "org/hibernate/test/annotations/onetoone/orm.xml" };
return new String[] { "org/hibernate/orm/test/annotations/onetoone/orm.xml" };
}
/**

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import java.util.concurrent.atomic.AtomicReference;
import javax.persistence.PersistenceException;
@ -148,8 +148,8 @@ public class OptionalOneToOneMappedByTest extends BaseCoreFunctionalTestCase {
}
);
CriteriaBuilder criteriaBuilder = session.getCriteriaBuilder();
doInHibernate( this::sessionFactory, session -> {
CriteriaBuilder criteriaBuilder = session.getCriteriaBuilder();
CriteriaQuery<PersonAddress> criteria = criteriaBuilder.createQuery( PersonAddress.class );
Root<PersonAddress> root = criteria.from( PersonAddress.class );
criteria.where( criteriaBuilder.equal( root.get("id"), _personAddress.getId()) );
@ -163,6 +163,7 @@ public class OptionalOneToOneMappedByTest extends BaseCoreFunctionalTestCase {
} );
doInHibernate( this::sessionFactory, session -> {
CriteriaBuilder criteriaBuilder = session.getCriteriaBuilder();
Person person = personHolder.get();
// this call throws GenericJDBCException
PersonAddress personAddress = session.createQuery(

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import javax.persistence.Entity;
import javax.persistence.Id;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import javax.persistence.ConstraintMode;
import javax.persistence.Entity;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import javax.persistence.PersistenceException;
import javax.persistence.criteria.CriteriaBuilder;
@ -167,6 +167,6 @@ public class OptionalOneToOnePKJCTest extends BaseCoreFunctionalTestCase {
@Override
protected String[] getOrmXmlFiles() {
return new String[] { "org/hibernate/test/annotations/onetoone/orm.xml" };
return new String[] { "org/hibernate/orm/test/annotations/onetoone/orm.xml" };
}
}

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;

View File

@ -6,7 +6,7 @@
*/
//$Id$
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.onetoone;
package org.hibernate.orm.test.annotations.onetoone;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

Some files were not shown because too many files have changed in this diff Show More