Open quaff opened 3 months ago
You mean like a CDI TypeLiteral
, right?
But what is the usecase here? For use with in
conditions? Or something else?
You mean like a CDI
TypeLiteral
, right?
Yes.
But what is the usecase here? For use with
in
conditions? Or something else?
Not in
but equal
.
@Entity
public class TestEntity {
@Id
@GeneratedValue
Long id;
List<Integer> list;
}
ParameterExpression<List<Integer>> parameter = criteriaBuilder.parameter(List.class); // cannot compile
Root<TestEntity> root = criteria.from(TestEntity.class);
criteria.select(root).where(criteriaBuilder.equal(root.get(TestEntity_.list), parameter));
I see. So I suppose this:
List<Integer> list;
is possible in standard JPA with an AttributeConverter
.
I see. So I suppose this:
List<Integer> list;
is possible in standard JPA with an
AttributeConverter
.
Hibernate will map it to array now, no need AttributeConverter
.
Right, I know that, but that's not standard in the Persistence spec.
is not type safe, We need add a Super Type Token like TypeReference