什么时候使用 ListPath (querydsl)?
when to use ListPath (querydsl)?
我有一个使用 listPath 的当前代码,但我在理解它以添加更改时遇到了问题。
我在 google 中搜索时没有找到有用的信息。
任何解释何时以及如何使用它?
例如,您可以加入 ListPath
给定实体元模型:
@Generated("com.querydsl.codegen.EntitySerializer")
public class QCat extends EntityPathBase<Cat> {
// Other fields omitted for brevity
public final ListPath<Cat, QCat> kittens = this.<Cat, QCat>createList("kittens", Cat.class, QCat.class, PathInits.DIRECT2);
例如,您可以这样做:
query().from(cat, cats)
.innerJoin(cat.kittens, kitten).where(kitten.name.eq("Kitty"))
.select(cat).fetch();
我有一个使用 listPath 的当前代码,但我在理解它以添加更改时遇到了问题。
我在 google 中搜索时没有找到有用的信息。
任何解释何时以及如何使用它?
例如,您可以加入 ListPath
给定实体元模型:
@Generated("com.querydsl.codegen.EntitySerializer")
public class QCat extends EntityPathBase<Cat> {
// Other fields omitted for brevity
public final ListPath<Cat, QCat> kittens = this.<Cat, QCat>createList("kittens", Cat.class, QCat.class, PathInits.DIRECT2);
例如,您可以这样做:
query().from(cat, cats)
.innerJoin(cat.kittens, kitten).where(kitten.name.eq("Kitty"))
.select(cat).fetch();