-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed as not planned
1 / 21 of 2 issues completedClosed as not planned
1 / 21 of 2 issues completed
Copy link
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertheme: aot
Description
@NoRepositoryBean
public interface BaseJpaRepository<T, ID> {
@Query("select t from #{#entityName} t where t.id = ?1")
T selectById(ID id);
}
public interface ARepository extends JpaRepository<A, Long>, BaseJpaRepository<A, Long> {
A getByName(String name);
}
@Generated
public class ARepositoryImpl__AotRepository extends AotRepositoryFragmentSupport {
private final RepositoryFactoryBeanSupport.FragmentCreationContext context;
private final EntityManager entityManager;
public ARepositoryImpl__AotRepository(EntityManager entityManager,
RepositoryFactoryBeanSupport.FragmentCreationContext context) {
super(QueryEnhancerSelector.DEFAULT_SELECTOR, context);
this.entityManager = entityManager;
this.context = context;
}
/**
* AOT generated implementation of {@link ARepository#getByName(java.lang.String)}.
*/
public A getByName(String name) {
String queryString = "SELECT a FROM io.xc.springboot4.A a WHERE a.name = :name";
Query query = this.entityManager.createQuery(queryString);
query.setParameter("name", name);
return (A) convertOne(query.getSingleResultOrNull(), false, A.class);
}
/**
* AOT generated implementation of {@link BaseJpaRepository#selectById(ID)}.
*/
public T selectById(ID id) {
String queryString = "select t from A t where t.id = ?1";
Query query = this.entityManager.createQuery(queryString);
query.setParameter(1, id);
return (T) convertOne(query.getSingleResultOrNull(), false, A.class);
}
}
expect:
/**
* AOT generated implementation of {@link BaseJpaRepository#selectById(ID)}.
*/
public A selectById(Long id) {
String queryString = "select t from io.xc.springboot4.A t where t.id = ?1";
Query query = this.entityManager.createQuery(queryString);
query.setParameter(1, id);
return (A) convertOne(query.getSingleResultOrNull(), false, A.class);
}
Sub-issues
Metadata
Metadata
Assignees
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertheme: aot