querydsl

    1熱度

    1回答

    Class對象,我有它返回的實體的Class對象我想要查詢的方法: protected abstract Class<T> getEntityClass(); ,後來我想查詢這個實體QueryDSL new JPAQuery<>(em).from(?????); 我該如何做到這一點?

    1熱度

    1回答

    這有什麼不妥以下QueryDSL代碼: query.from(chat).where( chat.datePosted.goe(startDate.atStartOfDay()). and(chat.datePosted.lt(endDate.plusDays(1).atStartOfDay()))). groupBy(date(chat.datePosted)). list(date(c

    2熱度

    1回答

    我在ES有兩個查詢。這兩份文件在同一組文件上有不同的週轉時間。兩者在概念上都做同樣的事情。我有一些疑問 1-這兩者有什麼區別? 2-哪一個更好用? 3-如果兩者相同,他們表現不同? 1. Filtered bool { "from": 0, "size": 5, "query": { "filtered": { "filter

    0熱度

    1回答

    在Spring JPA +查詢DSL創建和函數我有查詢像下面 select sum(qty)... from table where productname = 'Pepsi' group by product. 我在下面PathBuilderQueryDSL春代碼中創建: - PathBuilder<Stock> entityPath = new PathBuilder<Stock>(Sto

    0熱度

    1回答

    我在QueryDSL中使用Spring Data JPA,並試圖在where條件中使用Sum函數,因爲我使用分頁,所以我必須先計數。 所以我有一個像下面的Java代碼: - NumberPath<Double> path = entityPath.getNumber("qty", Double.class); BooleanExpression exp = path.sum().loe(120)

    0熱度

    1回答

    我需要使用多個數據庫。 我使用Spring引導+彈簧數據JPA, 所以我有兩個配置類: @Configuration @EnableTransactionManagement @EnableJpaRepositories(basePackages="com.rest.dao.first", entityManagerFactoryRef = "firstEntityManagerF

    5熱度

    1回答

    繼official documentation高級比較,增加@EnableSpringDataWebSupport註解到我的Spring配置允許查詢自動注入Predicate類: @RequestMapping(method = RequestMethod.GET, path="/find") public ResponseEntity<PagedResources<FooResource>>

    3熱度

    1回答

    我正在研究基於QueryDSL並使用SpringData進行查詢執行的動態過濾器組件。因此,我從收到的數據廣告中將Predicate個實例創建爲QueryDslPredicateExecutor。對於動態訪問實體屬性,我使用類型爲實體類的通用PathBuilder。 考慮以下(簡化)代碼: class Offer { List<LanguageToName> names; } cla

    0熱度

    1回答

    @Document(collection="users") public class User{ @Id private int id; private String name; ... //getters-setters } @Document(collection="models") public class Model{

    0熱度

    2回答

    這是我的搜索過濾器查詢條件, 我想給「和」條件的條件。 現在,我已經給了必須過濾條件 'query' => [ "filtered" => [ "query" => [ "match_all" => [] ], "filter" => [ "bool" => [ "must" => [ "t