HHH-16633 test for AccessType.PROPERTY in @Find method parameter matching

This commit is contained in:
Gavin King 2023-07-13 10:14:38 +02:00
parent 8681d702a4
commit 5c5d2c2f94
3 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,15 @@
package org.hibernate.jpamodelgen.test.dao;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
@Entity
public class Bean {
@Id
public Long getKey() {
return 69L;
}
public String getText() {
return "Hello World";
}
}

View File

@ -60,4 +60,10 @@ public interface Dao {
@SQL("select * from Book where isbn = :isbn")
Book findByIsbnNative(String isbn);
@Find
Bean beanByIdProperty(Long key);
@Find
List<Bean> beansForText(String text);
}

View File

@ -18,7 +18,7 @@ import static org.hibernate.jpamodelgen.test.util.TestUtil.assertMetamodelClassG
*/
public class DaoTest extends CompilationTest {
@Test
@WithClasses({ Book.class, Dao.class, StatefulDao.class, StatelessDao.class })
@WithClasses({ Book.class, Dao.class, Bean.class, StatefulDao.class, StatelessDao.class })
public void testGeneratedAnnotationNotGenerated() {
System.out.println( TestUtil.getMetaModelSourceAsString( Dao.class ) );
System.out.println( TestUtil.getMetaModelSourceAsString( StatefulDao.class ) );