clean up remaining test suite failures

This commit is contained in:
Steve Ebersole 2022-01-18 17:16:23 -06:00
parent e8d8b43bfd
commit 7437a96b12
3 changed files with 22 additions and 24 deletions

View File

@ -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.annotations.LazyToOne;
import org.hibernate.annotations.LazyToOneOption;
@ -23,7 +30,6 @@ import jakarta.persistence.Table;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.JoinType;
import java.util.List;
import static org.hibernate.Hibernate.isInitialized;
import static org.hibernate.Hibernate.isPropertyInitialized;
@ -82,14 +88,11 @@ public class HHH3949Test extends BaseCoreFunctionalTestCase {
@Test
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" );
}
@Test
public void test2() {
performQueryAndVerifyVehicleResults( "from Vehicle v fetch all properties left join fetch v.driver" );
performQueryAndVerifyVehicleResults( "from Vehicle v left join fetch v.driver" );
}

View File

@ -1,10 +1,10 @@
/*
* 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>.
* 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.bytecode.enhancement.lazyCache;
package org.hibernate.orm.test.bytecode.enhancement.lazyCache;
import java.util.Date;
import java.util.Locale;
@ -26,6 +26,8 @@ import org.hibernate.cache.spi.entry.StandardCacheEntryImpl;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.cfg.Configuration;
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.testing.bytecode.enhancement.BytecodeEnhancerRunner;
@ -81,13 +83,17 @@ public class InitFromCacheTest extends BaseCoreFunctionalTestCase {
doInHibernate(
this::sessionFactory,
s -> {
Document d = (Document) s.createQuery( "from Document fetch all properties" ).uniqueResult();
assertTrue( isPropertyInitialized( d, "text" ) );
assertTrue( isPropertyInitialized( d, "summary" ) );
final RootGraph<Document> entityGraph = s.createEntityGraph( Document.class );
entityGraph.addAttributeNodes( "text", "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 Object cacheKey = entityDataAccess.generateCacheKey(
d.id,
document.id,
persister,
sessionFactory(),
null

View File

@ -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;