clean up remaining test suite failures
This commit is contained in:
parent
e8d8b43bfd
commit
7437a96b12
|
@ -1,6 +1,13 @@
|
||||||
package org.hibernate.test.bytecode.enhancement.join;
|
/*
|
||||||
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
|
*
|
||||||
|
* 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.orm.test.bytecode.enhancement.join;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.FetchMode;
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.annotations.LazyToOne;
|
import org.hibernate.annotations.LazyToOne;
|
||||||
import org.hibernate.annotations.LazyToOneOption;
|
import org.hibernate.annotations.LazyToOneOption;
|
||||||
|
@ -23,7 +30,6 @@ import jakarta.persistence.Table;
|
||||||
import jakarta.persistence.criteria.CriteriaBuilder;
|
import jakarta.persistence.criteria.CriteriaBuilder;
|
||||||
import jakarta.persistence.criteria.CriteriaQuery;
|
import jakarta.persistence.criteria.CriteriaQuery;
|
||||||
import jakarta.persistence.criteria.JoinType;
|
import jakarta.persistence.criteria.JoinType;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static org.hibernate.Hibernate.isInitialized;
|
import static org.hibernate.Hibernate.isInitialized;
|
||||||
import static org.hibernate.Hibernate.isPropertyInitialized;
|
import static org.hibernate.Hibernate.isPropertyInitialized;
|
||||||
|
@ -82,14 +88,11 @@ public class HHH3949Test extends BaseCoreFunctionalTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test1() {
|
public void test1() {
|
||||||
// verify the work around query
|
|
||||||
performQueryAndVerifyPersonResults( "from Person p fetch all properties left join fetch p.vehicle" );
|
|
||||||
performQueryAndVerifyPersonResults( "from Person p left join fetch p.vehicle" );
|
performQueryAndVerifyPersonResults( "from Person p left join fetch p.vehicle" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test2() {
|
public void test2() {
|
||||||
performQueryAndVerifyVehicleResults( "from Vehicle v fetch all properties left join fetch v.driver" );
|
|
||||||
performQueryAndVerifyVehicleResults( "from Vehicle v left join fetch v.driver" );
|
performQueryAndVerifyVehicleResults( "from Vehicle v left join fetch v.driver" );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
*
|
*
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.bytecode.enhancement.lazyCache;
|
package org.hibernate.orm.test.bytecode.enhancement.lazyCache;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
@ -26,6 +26,8 @@ import org.hibernate.cache.spi.entry.StandardCacheEntryImpl;
|
||||||
import org.hibernate.cfg.AvailableSettings;
|
import org.hibernate.cfg.AvailableSettings;
|
||||||
import org.hibernate.cfg.Configuration;
|
import org.hibernate.cfg.Configuration;
|
||||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||||
|
import org.hibernate.graph.RootGraph;
|
||||||
|
import org.hibernate.jpa.QueryHints;
|
||||||
import org.hibernate.persister.entity.EntityPersister;
|
import org.hibernate.persister.entity.EntityPersister;
|
||||||
|
|
||||||
import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner;
|
import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner;
|
||||||
|
@ -81,13 +83,17 @@ public class InitFromCacheTest extends BaseCoreFunctionalTestCase {
|
||||||
doInHibernate(
|
doInHibernate(
|
||||||
this::sessionFactory,
|
this::sessionFactory,
|
||||||
s -> {
|
s -> {
|
||||||
Document d = (Document) s.createQuery( "from Document fetch all properties" ).uniqueResult();
|
final RootGraph<Document> entityGraph = s.createEntityGraph( Document.class );
|
||||||
assertTrue( isPropertyInitialized( d, "text" ) );
|
entityGraph.addAttributeNodes( "text", "summary" );
|
||||||
assertTrue( isPropertyInitialized( d, "summary" ) );
|
final Document document = s.createQuery( "from Document", Document.class )
|
||||||
|
.setHint( QueryHints.JAKARTA_HINT_FETCH_GRAPH, entityGraph )
|
||||||
|
.uniqueResult();
|
||||||
|
assertTrue( isPropertyInitialized( document, "text" ) );
|
||||||
|
assertTrue( isPropertyInitialized( document, "summary" ) );
|
||||||
|
|
||||||
final EntityDataAccess entityDataAccess = persister.getCacheAccessStrategy();
|
final EntityDataAccess entityDataAccess = persister.getCacheAccessStrategy();
|
||||||
final Object cacheKey = entityDataAccess.generateCacheKey(
|
final Object cacheKey = entityDataAccess.generateCacheKey(
|
||||||
d.id,
|
document.id,
|
||||||
persister,
|
persister,
|
||||||
sessionFactory(),
|
sessionFactory(),
|
||||||
null
|
null
|
|
@ -1,11 +0,0 @@
|
||||||
/*
|
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests for lazy-enhancement-as-proxy support
|
|
||||||
*/
|
|
||||||
package org.hibernate.test.bytecode.enhancement.lazy.proxy;
|
|
Loading…
Reference in New Issue