Unified Queries for Java

Related tags

Database querydsl
Overview

Querydsl

Querydsl is a framework which enables the construction of type-safe SQL-like queries for multiple backends including JPA, MongoDB and SQL in Java.

Instead of writing queries as inline strings or externalizing them into XML files they are constructed via a fluent API.

Website shields.io Build Status Coverage Status Stackoverflow Maven Central

Getting started

Use these tutorials to get started

Examples

Querydsl example projects

Support

Free support is provided in the Querydsl Google Group and on StackOverflow.

How to build

Querydsl provides releases via public Maven repositories, but you can also build the sources yourself like this

$ mvn -Pquickbuild,{projectname} clean install

Where projectname is one of the Maven profiles (e.g. jpa, sql, mongodb, etc. or all)

For more information visit the project homepage at http://www.querydsl.com/.

Vagrant/Puppet setup

For running tests, a Vagrant/Puppet setup is provided. It is based on Ubuntu 12.04 and comes with the following databases:

  • Oracle Express Edition 11g
  • PostgreSQL 9.1.10
  • MySQL 5.5.34
  • Cubrid 9.2

You will need to install VirtualBox, Puppet, Vagrant, the vagrant-vbguest plugin and librarian-puppet. You will also need to download the Oracle XE 11g installer file (oracle-xe-11.2.0-1.0.x86_64.rpm.zip) manually and place it in the devops directory.

To launch the virtual machine:

$ cd devops
$ librarian-puppet install
$ vagrant up

All of the databases' default ports are forwarded to the host machine. See the Vagrantfile for details.

How to contribute

GitHub pull requests are the way to contribute to Querydsl.

If you are unsure about the details of a contribution, ask on the Querydsl Google Group or create a ticket on GitHub.

Comments
  • querydsl ownership handover approved - owner and contributors wanted

    querydsl ownership handover approved - owner and contributors wanted

    On the back of the various "status of querydsl" issues, such as #2456 and this SO post, I've been in contact Timo Westkämper project owner and can confirm he's approved handover of the project, so we don't have to fork.

    Firstly, let's say a huge thank you to Timo for his time, effort and talent creating this wonderful project that we all want to see succeed long term.

    Now comes the difficult part. Who would like to take ownership of the project and who would like to contribute? I dip in and out due to work/life commitments and can't commit to working on it regularly.

    To get the project out of its "dead" status, we need open source contributors who have the time and passion to move the codebase forward. Who's in?


    Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

    wontfix 
    opened by robertandrewbain 108
  • Hibernate 5.2 method signature incompatibilty

    Hibernate 5.2 method signature incompatibilty

    I tried out the latest Query DSL 4.1.2 and Hibernate 5.2, and hibernate appears to have changed method signatures.

    java.lang.NoSuchMethodError: org.hibernate.Session.createQuery(Ljava/lang/String;)Lorg/hibernate/Query;
        at com.querydsl.jpa.hibernate.DefaultSessionHolder.createQuery(DefaultSessionHolder.java:36)
        at com.querydsl.jpa.hibernate.AbstractHibernateQuery.createQuery(AbstractHibernateQuery.java:104)
        at com.querydsl.jpa.hibernate.AbstractHibernateQuery.createQuery(AbstractHibernateQuery.java:97)
        at com.querydsl.jpa.hibernate.AbstractHibernateQuery.fetch(AbstractHibernateQuery.java:174)
    

    The Query class moved from org.hibernate to org.hibernate.query so the APIs don't match anymore.

    I'm sure there are more broken areas as well.

    opened by johnjaylward 67
  • Generated class does not pass inits to embedded class in Constructor. NPE due to Path Initialization Problems.

    Generated class does not pass inits to embedded class in Constructor. NPE due to Path Initialization Problems.

    The HibernateDomainExporter and the JPAAnnotationProcessor seem to produce different results. Moreover, the JPAAnnotationProcessor produces an unusable result with PathInit Problems.

    Functional Result using JPA Mapping File and HibernateDomainExporter:

    public QMyEntity(Class<? extends MyEntity> type, PathMetadata metadata, PathInits inits) extends MyMappedSuperclass {
         super(type, metadata, inits);
         this._super = new QMyMappedSuperclass(type, metadata, inits);
         this.embeddedAttribute= inits.isInitialized("embeddedAttribute") ? new QMyEmbeddedAttribute(forProperty("embeddedAttribute"), inits.get("embeddedAttribute")) : null;
    }
    

    Nonfunctional result with Path Init Problems using JPAAnnotationGenerator and JPA Annotations. QueryInit Annotation does not help because Constructor ignores them. The second inits.get("embeddedAttribute") argument to the Constructor of QMyEmbeddedAttribute is missing in the following generated code:

    public QMyEntity(Class<? extends MyEntity> type, PathMetadata metadata, PathInits inits) extends MyMappedSuperclass {
            super(type, metadata, inits);
            this._super = new QMyMappedSuperclass(type, metadata, inits);
            this.embeddedAttribute = inits.isInitialized("embeddedAttribute") ? new QMyEmbeddedAttribue(forProperty("embeddedAttribute")) : null;
    }
    
    opened by tpischke 43
  • Kotlin support

    Kotlin support

    Kotlin is pretty popular these days, and it would be nice to have Kotlin support in Query DSL, in addition to the Scala one. It could allow me to use Query DSL SQL for the use case I have detail on https://spring.io/blog/2016/03/20/a-geospatial-messenger-with-kotlin-spring-boot-and-postgresql.

    feature 
    opened by sdeleuze 39
  • Allow join on primary key ids so as to offer a work around an Hibernate issue

    Allow join on primary key ids so as to offer a work around an Hibernate issue

    The following Hibernate issue can be worked around by having the oin on done on the primary key ids instead of on the objects: https://hibernate.atlassian.net/browse/HHH-2772

    It would be helpful if the JPAQueryBase innerJoin method would also accept Long parameters.

    We would then be able to do a: query.innerJoin(qRolloutAdmin.rollout).on(qRolloutAdmin.rollout.id.eq(qRollout.id));

    opened by stephaneeybert 37
  • Is querydsl dead?

    Is querydsl dead?

    Hi,

    I cannot fail to notice that the project has 249 outstanding issues, 32 PR-s, no merges since february, etc. Is the project dead?

    I think there are more than a few people willing to help resolve issues, but at this pace of merging it hardly motivates people to use querydsl at all.

    Not sure how other people do this, but for me if a project has outstanding issues but no commits since months, that's a red flag, and I won't be using that tool.

    Please either resolve the issues without fixes, or onboard someone to help out.

    Keeping the project in this seemingly dead state won't help and it would be a shame if people don't use this awesome tool just because it looks like it's abandoned.

    Thanks, A concerned user of querydsl

    opened by reegnz 35
  • Connection pooling does not appear to be correctly supported

    Connection pooling does not appear to be correctly supported

    Using database connection pooling with org.apache.commons.dbcp2.BasicDataSource, upon executing a SQLQuery the connection is never returned to the pool, unless you put it inside a transaction, which is not always convenient. The following workaround manually closes the connection, returning it to the pool.

    protected Connection getSQLQueryConnection(@NonNull SQLQuery query) {
        Field declaredField;
        try {
            declaredField = SQLQuery.class.getSuperclass().getDeclaredField("conn");
            declaredField.setAccessible(true);
            return (Connection) declaredField.get(query);
        } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
            log.error("Could not retrieve connection object from Object {}", query);
        }
    
        return null;
    }
    
    protected void closeSQLQuery(@NonNull SQLQuery query) {
        try {
            if (!TransactionSynchronizationManager.isActualTransactionActive()) {
                getSQLQueryConnection(query).close();
            } else {
                log.warn("Not closing connection on transaction wrapped connection {}", query);
            }
        } catch (SQLException e) {
            log.error("Could not close connection {}", query, e);
        }
    }
    

    The most notable drawback with this mechanism is the fact that it relies on the programmer knowing that this must be called, otherwise the connection pool will soon run out of available connections.

    It would be far better if querydsl could provide support for connection pooling, ensuring that connections are returned to the pool upon execution finishing.

    feature 
    opened by robertandrewbain 29
  • Entity model using interfaces does not generate Q classes correctly

    Entity model using interfaces does not generate Q classes correctly

    Our JPA entity model uses interfaces extensively and it seems that QueryDSL does not handle them correctly.

    Here is an example of our model:

    @Entity
    @Table(name = "USERS")
    @org.hibernate.annotations.AccessType("field")
    @org.hibernate.annotations.Proxy(proxyClass = User.class)
    public class UserImpl extends EntityImpl implements User {
    
        @NaturalId(mutable = true)
        @Column(name = "USERNAME", nullable = false)
        private String username;
    
        @ManyToOne(cascade = {CascadeType.ALL}, fetch = FetchType.EAGER, targetEntity = PartyImpl.class)
        @JoinColumn(name = "PARTY_ID", nullable = false)
        private Party party;
    }
    
    @javax.persistence.Entity
    @Table(name = "PARTY")
    @org.hibernate.annotations.AccessType("field")
    @org.hibernate.annotations.Proxy(proxyClass = Party.class)
    public abstract class PartyImpl extends EntityImpl implements Party {
    
        @Column(name = "NAME", nullable = false)
        private String name;
    
    }
    

    Which generates a QUserImpl with the following field:

    public final SimplePath<Party> party = createSimple("party", Party.class);
    

    However, I believe it should look more like:

    this.party = inits.isInitialized("party") ? new QPartyImpl(forProperty("party"), inits.get("party")) : null;
    

    From reading the code it seems that the targetEntity attribute of the ManyToOne annotation is not being inspected. Is this type of model not supported? Or is there something else I need to do to make this work?

    Regards, Damien

    opened by damienhollis 29
  • [2.8.1] QueryDSL JPA on AppEngine not working because of escape character

    [2.8.1] QueryDSL JPA on AppEngine not working because of escape character

    I tried to get querydsl working on AppEngine today. I'm using querydsl via the Spring Data JPA repository support.

    As soon as I try to run querydsl filter containing a 'startsWith' I get the below exception. When I use dynamic query methods or Spring Data Specifications I don't run in this issue.

    org.springframework.orm.jpa.JpaSystemException: Problem with query <SELECT FROM User user WHERE user.username like ?1 escape '!' ORDER BY user.username asc>: GAE doesn't currently support ESCAPE syntax (Literal{!}); nested exception is javax.persistence.PersistenceException: Problem with query <SELECT FROM User user WHERE user.username like ?1 escape '!' ORDER BY user.username asc>: GAE doesn't currently support ESCAPE syntax (Literal{!})
        at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:326)
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:403)
        at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58)
        at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:163)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.data.jpa.repository.support.LockModeRepositoryPostProcessor$LockModePopulatingMethodIntercceptor.invoke(LockModeRepositoryPostProcessor.java:91)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.zeroturnaround.javarebel.integration.util.ReloadingProxyFactory$ReloadingMethodHandler.invoke(JRebel:73)
        at nl.valid.minerva.web.UserController.list(UserController.java:45)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:115)
        at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:757)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:698)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:911)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:807)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:792)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
        at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:180)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:123)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:61)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:97)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
        at org.mortbay.jetty.handler.ContextHandler.__handle(ContextHandler.java:765)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
        at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:94)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:383)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
    Caused by: javax.persistence.PersistenceException: Problem with query <SELECT FROM User user WHERE user.username like ?1 escape '!' ORDER BY user.username asc>: GAE doesn't currently support ESCAPE syntax (Literal{!})
        at org.datanucleus.api.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:302)
        at org.datanucleus.api.jpa.JPAQuery.getResultList(JPAQuery.java:202)
        at com.mysema.query.jpa.impl.AbstractJPAQuery.getResultList(AbstractJPAQuery.java:221)
        at com.mysema.query.jpa.impl.AbstractJPAQuery.list(AbstractJPAQuery.java:273)
        at org.springframework.data.jpa.repository.support.QueryDslJpaRepository.findAll(QueryDslJpaRepository.java:113)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:115)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:334)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:319)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
        ... 100 more
    Caused by: com.google.appengine.datanucleus.query.DatastoreQuery$UnsupportedDatastoreFeatureException: Problem with query <SELECT FROM User user WHERE user.username like ?1 escape '!' ORDER BY user.username asc>: GAE doesn't currently support ESCAPE syntax (Literal{!})
        at com.google.appengine.datanucleus.query.DatastoreQuery.handleMatchesOperation(DatastoreQuery.java:837)
        at com.google.appengine.datanucleus.query.DatastoreQuery.addExpression(DatastoreQuery.java:816)
        at com.google.appengine.datanucleus.query.DatastoreQuery.addFilters(DatastoreQuery.java:721)
        at com.google.appengine.datanucleus.query.DatastoreQuery.compile(DatastoreQuery.java:247)
        at com.google.appengine.datanucleus.query.JPQLQuery.performExecute(JPQLQuery.java:170)
        at org.datanucleus.store.query.Query.executeQuery(Query.java:1789)
        at org.datanucleus.store.query.Query.executeWithMap(Query.java:1693)
        at org.datanucleus.api.jpa.JPAQuery.getResultList(JPAQuery.java:185)
        ... 114 more
    
    opened by marceloverdijk 28
  • maven-apt-plugin fails to configure lifecylce for m2eclipse 0.13.x

    maven-apt-plugin fails to configure lifecylce for m2eclipse 0.13.x

    When i try to import a query-dsl test project i'm getting the following error:

    Plugin execution not covered by lifecycle configuration: com.mysema.maven:maven-apt-plugin:1.0:process (execution: default, phase: generate-sources)

    The result is, i'm not getting the generated-sources directory in eclipse anymore. Is it possible to use the standard jdk 1.6 apt processor for querydsl ?

    bug 
    opened by timowest 28
  • QueryException truncates chained SQLExceptions

    QueryException truncates chained SQLExceptions

    In the case of batch queries, SQLException may reference one or more exceptions behind SQLException.getNextException() or SQLException.iterator(). Because SQLException.getCause() is not set, QueryException.printStackTrace() truncates this information. See https://groups.google.com/d/msg/h2-database/OrCkGSpe2BQ/bTGCaAbGixgJ for an example of what the output looks like.

    I think we should try converting SQLException.getNextException() to SQLException.addSuppressed(). I suspect (though this needs to be tested) that QueryException.printStackTrace() would then work as expected.

    I propose the following:

    1. If QueryException's constructor is passed a SQLException, then iterate through the chained exceptions and addSuppressed() on any exception that isn't already returned by getSuppressed().
    2. Create a testcase to ensure that QueryException.printStackTrace() prints these chained stack-traces in full.
    opened by cowwoc 27
  • QueryDelegates do not resolve properly for entity types with a generic parameter

    QueryDelegates do not resolve properly for entity types with a generic parameter

    Observed vs. expected behavior

    @QueryDelegate(SomeEntity.class) is not applied when the entity has a generic parameter, like so: SomeEntity<T>.

    Steps to reproduce

    Environment

    Querydsl version:

    Querydsl module:

    Database:

    JDK:

    Additional details

    bug 
    opened by jwgmeligmeyling 0
  • Bump spring-boot-starter-parent from 2.6.7 to 3.0.1

    Bump spring-boot-starter-parent from 2.6.7 to 3.0.1

    Bumps spring-boot-starter-parent from 2.6.7 to 3.0.1.

    Release notes

    Sourced from spring-boot-starter-parent's releases.

    v3.0.1

    :lady_beetle: Bug Fixes

    • Fix typo in LocalDevToolsAutoConfiguration logging #33615
    • No warning is given when <springProfile> is used in a Logback <root> block #33610
    • Auto-configure PropagationWebGraphQlInterceptor for tracing propagation #33542
    • WebClient instrumentation fails with IllegalArgumentException when adapting to WebClientExchangeTagsProvider #33483
    • Reactive observation auto-configuration does not declare order for WebFilter #33444
    • Web server fails to start due to "Resource location must not be null" when attempting to use a PKCS 11 KeyStore #33433
    • Actuator health endpoint for neo4j throws NoSuchElementException and always returns Status.DOWN #33428
    • Anchors in YAML configuration files throw UnsupportedOperationException #33404
    • ZipkinRestTemplateSender is not customizable #33399
    • AOT doesn't work with Logstash Logback Encoder #33387
    • Maven process-aot goal fails when release version is set in Maven compiler plugin #33382
    • DependsOnDatabaseInitializationPostProcessor re-declares bean dependencies at native image runtime #33374
    • @SpringBootTest now throws a NullPointerException rather than a helpful IllegalStateException when @SpringBootConfiguration is not found #33371
    • bootBuildImage always trys to create a native image due to bootJar always adding a META-INF/native-image/argfile to the jar #33363

    :notebook_with_decorative_cover: Documentation

    • Improve gradle plugin tags documentation #33617
    • Improve maven plugin tags documentation #33616
    • Fix typo in tomcat accesslog checkExists doc #33512
    • Documented Java compiler level is wrong #33505
    • Fix typo in documentation #33453
    • Update instead of replace environment in bootBuildImage documentation #33424
    • Update the reference docs to document the need to declare the native-maven-plugin when using buildpacks to create a native image #33422
    • Document that the shutdown endpoint is not intended for use when deploying a war to a servlet container #33410
    • Reinstate GraphQL testing documentaion #33407
    • Description of NEVER in Sanitize Sensitive Values isn't formatted correctly #33398

    :hammer: Dependency Upgrades

    • Upgrade to AspectJ 1.9.19 #33586
    • Upgrade to Byte Buddy 1.12.20 #33587
    • Upgrade to Couchbase Client 3.4.1 #33588
    • Upgrade to Dropwizard Metrics 4.2.14 #33589
    • Upgrade to Elasticsearch Client 8.5.3 #33590
    • Upgrade to Hibernate 6.1.6.Final #33591
    • Upgrade to HttpClient 4.5.14 #33592
    • Upgrade to HttpCore 4.4.16 #33593
    • Upgrade to Infinispan 14.0.4.Final #33594
    • Upgrade to Jaybird 4.0.8.java11 #33595
    • Upgrade to Jetty 11.0.13 #33596
    • Upgrade to jOOQ 3.17.6 #33597
    • Upgrade to Kotlin 1.7.22 #33598
    • Upgrade to Lettuce 6.2.2.RELEASE #33599
    • Upgrade to MongoDB 4.8.1 #33600
    • Upgrade to MSSQL JDBC 11.2.2.jre17 #33601
    • Upgrade to Native Build Tools Plugin 0.9.19 #33602

    ... (truncated)

    Commits
    • 837947c Release v3.0.1
    • 5929d95 Merge branch '2.7.x'
    • b10b788 Next development version (v2.7.8-SNAPSHOT)
    • f588793 Update copyright year of changed files
    • 0254619 Merge branch '2.7.x'
    • e4772cf Update copyright year of changed files
    • 2e7ca6f Warning if <springProfile> is used in phase 2 model elements
    • 2ed512d Use model.deepMarkAsSkipped in SpringProfileModelHandler
    • 532fed3 Increase couchbase connection timeout for tests
    • 9562a2c Merge branch '2.7.x'
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Exceptions when using subqueries in SpringBoot 3

    Exceptions when using subqueries in SpringBoot 3

    Version

    Spring Boot: 3.0.1 JDK: 17 MYSQL: 8.0.27 QueryDsl: 5.0.0 Hibernate: 6.1.6

    Example code: https://github.com/KevinBlandy/springboo3-querydsl

    Query

    @Test
    @Transactional(readOnly = true)
    public void test () {
    	var tag = QTag.tag;
    	var postTag = QPostTag.postTag;
    	var post = QPost.post;
    	
    	var query = new JPAQueryFactory(this.entityManager);
    	
    	SimpleExpression<Long> postCount = Expressions.as(JPAExpressions
    				.select(Expressions.ONE.count())
    				.from(postTag)
    				.innerJoin(post).on(post.id.eq(postTag.postId))
    				.where(postTag.tagId.eq(tag.id)
    					.and(post.enabled.eq(true)	
    					.and(post.deleted.eq(0L))) 
    				)
    		, "post_count");
    	
    	var tuple = query.select(tag.id, tag.title, tag.icon, tag.instruction, tag.enabled, tag.path, postCount)
    			.from(tag)
    			.where(tag.id.eq(10000L))
    			.fetchOne();
    	
    	log.info("tuple:{}", tuple);
    }
    

    Generated SQL

    2022-12-23T17:36:58.570+08:00  INFO 580 --- [           main] example.text.ExampleApplicationTest      : Started ExampleApplicationTest in 6.0 seconds (process running for 7.253)
    Hibernate: 
        select
            t1_0.id,
            t1_0.title,
            t1_0.icon,
            t1_0.instruction,
            t1_0.enabled,
            t1_0.path,
            (select
                count(1) 
            from
                post_tag p1_0 
            join
                post p2_0 
                    on p2_0.id=p1_0.post_id 
            where
                p1_0.tag_id=t1_0.id 
                and (
                    p2_0.enabled=abs(sign(?)) 
                    and p2_0.deleted=cast(? as BIGINT UNSIGNED COMMENT '是否删除。0:未删除,非0:删除时间戳')
                )) 
        from
            tag t1_0 
        where
            t1_0.id=?
    2022-12-23T17:36:59.843+08:00 TRACE 580 --- [           main] org.hibernate.orm.jdbc.bind              : binding parameter [1] as [BOOLEAN] - [true]
    2022-12-23T17:36:59.845+08:00 TRACE 580 --- [           main] org.hibernate.orm.jdbc.bind              : binding parameter [2] as [BIGINT] - [0]
    2022-12-23T17:36:59.845+08:00 TRACE 580 --- [           main] org.hibernate.orm.jdbc.bind              : binding parameter [3] as [BIGINT] - [10000]
    2022-12-23T17:36:59.865+08:00  WARN 580 --- [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 1064, SQLState: 42000
    2022-12-23T17:36:59.865+08:00 ERROR 580 --- [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIGINT UNSIGNED COMMENT '是否删除。0:未删除,非0:删除时间戳')' at line 1
    

    I used a subquery in my query, but the generated SQL used a function that didn't look like a mysql dialect, which caused an exception.

    And the column comments defined in the @Column annotation are parsed into the SQL.

    Stack

    jakarta.persistence.PersistenceException: Converting `org.hibernate.exception.SQLGrammarException` to JPA `PersistenceException` : JDBC exception executing SQL [select t1_0.id,t1_0.title,t1_0.icon,t1_0.instruction,t1_0.enabled,t1_0.path,(select count(1) from post_tag p1_0 join post p2_0 on p2_0.id=p1_0.post_id where p1_0.tag_id=t1_0.id and (p2_0.enabled=abs(sign(?)) and p2_0.deleted=cast(? as BIGINT UNSIGNED COMMENT '是否删除。0:未删除,非0:删除时间戳'))) from tag t1_0 where t1_0.id=?]
    	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:165)
    	at org.hibernate.query.spi.AbstractSelectionQuery.list(AbstractSelectionQuery.java:374)
    	at org.hibernate.query.sqm.internal.QuerySqmImpl.list(QuerySqmImpl.java:1073)
    	at org.hibernate.query.spi.AbstractSelectionQuery.getSingleResult(AbstractSelectionQuery.java:457)
    	at org.hibernate.query.sqm.internal.QuerySqmImpl.getSingleResult(QuerySqmImpl.java:1103)
    	at com.querydsl.jpa.impl.AbstractJPAQuery.getSingleResult(AbstractJPAQuery.java:214)
    	at com.querydsl.jpa.impl.AbstractJPAQuery.fetchOne(AbstractJPAQuery.java:326)
    	at example.text.ExampleApplicationTest.test(ExampleApplicationTest.java:56)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
    	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:76)
    	at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
    	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
    	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
    	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
    	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
    	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    	at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:42)
    	at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
    	at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:72)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:95)
    	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:91)
    	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:60)
    	at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:98)
    	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
    Caused by: org.hibernate.exception.SQLGrammarException: JDBC exception executing SQL [select t1_0.id,t1_0.title,t1_0.icon,t1_0.instruction,t1_0.enabled,t1_0.path,(select count(1) from post_tag p1_0 join post p2_0 on p2_0.id=p1_0.post_id where p1_0.tag_id=t1_0.id and (p2_0.enabled=abs(sign(?)) and p2_0.deleted=cast(? as BIGINT UNSIGNED COMMENT '是否删除。0:未删除,非0:删除时间戳'))) from tag t1_0 where t1_0.id=?]
    	at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:64)
    	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:56)
    	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)
    	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:95)
    	at org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess.executeQuery(DeferredResultSetAccess.java:253)
    	at org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess.getResultSet(DeferredResultSetAccess.java:146)
    	at org.hibernate.sql.results.jdbc.internal.JdbcValuesResultSetImpl.advanceNext(JdbcValuesResultSetImpl.java:205)
    	at org.hibernate.sql.results.jdbc.internal.JdbcValuesResultSetImpl.processNext(JdbcValuesResultSetImpl.java:85)
    	at org.hibernate.sql.results.jdbc.internal.AbstractJdbcValues.next(AbstractJdbcValues.java:29)
    	at org.hibernate.sql.results.internal.RowProcessingStateStandardImpl.next(RowProcessingStateStandardImpl.java:88)
    	at org.hibernate.sql.results.spi.ListResultsConsumer.consume(ListResultsConsumer.java:197)
    	at org.hibernate.sql.results.spi.ListResultsConsumer.consume(ListResultsConsumer.java:33)
    	at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.doExecuteQuery(JdbcSelectExecutorStandardImpl.java:443)
    	at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.executeQuery(JdbcSelectExecutorStandardImpl.java:166)
    	at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.list(JdbcSelectExecutorStandardImpl.java:91)
    	at org.hibernate.sql.exec.spi.JdbcSelectExecutor.list(JdbcSelectExecutor.java:31)
    	at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.lambda$new$0(ConcreteSqmSelectQueryPlan.java:113)
    	at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.withCacheableSqmInterpretation(ConcreteSqmSelectQueryPlan.java:335)
    	at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.performList(ConcreteSqmSelectQueryPlan.java:276)
    	at org.hibernate.query.sqm.internal.QuerySqmImpl.doList(QuerySqmImpl.java:571)
    	at org.hibernate.query.spi.AbstractSelectionQuery.list(AbstractSelectionQuery.java:363)
    	... 53 more
    Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIGINT UNSIGNED COMMENT '是否删除。0:未删除,非0:删除时间戳')' at line 1
    	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
    	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:916)
    	at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:972)
    	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
    	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
    	at org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess.executeQuery(DeferredResultSetAccess.java:217)
    	... 69 more
    

    application.yml

    server:
     port: 8088
     
    logging:
     level:
       "org.hibernate.orm.jdbc.bind": TRACE
    
    spring:
     datasource:
       type: com.zaxxer.hikari.HikariDataSource
       driver-class-name: com.mysql.cj.jdbc.Driver
       url: jdbc:mysql://127.0.0.1:3306/demo?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
       username: root
       password: root
    
     jpa:
       database-platform: org.hibernate.dialect.MySQLDialect
       open-in-view: false
       hibernate:
         ddl-auto: none
       show-sql: true
       properties:
         "hibernate.format_sql": true
    

    This query works fine on SpringBoot 2.7.6.

    2022-12-23 17:59:46.295  INFO 13964 --- [           main] o.s.t.c.transaction.TransactionContext   : Began transaction (1) for test context [DefaultTestContext@765f05af testClass = ExampleApplicationTest, testInstance = example.text.ExampleApplicationTest@5bd82fed, testMethod = test@ExampleApplicationTest, testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@62f68dff testClass = ExampleApplicationTest, locations = '{}', classes = '{class example.ExampleApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true, server.port=0}', contextCustomizers = set[org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@2a693f59, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@723ca036, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@7a5ceedd, org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@43f02ef2, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@33ecda92, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@2dc54ad4], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> false, 'org.springframework.test.context.event.ApplicationEventsTestExecutionListener.recordApplicationEvents' -> false]]; transaction manager [org.springframework.orm.jpa.JpaTransactionManager@2ea0161f]; rollback [true]
    Hibernate: 
        select
            tag0_.id as col_0_0_,
            tag0_.title as col_1_0_,
            tag0_.icon as col_2_0_,
            tag0_.instruction as col_3_0_,
            tag0_.enabled as col_4_0_,
            tag0_.path as col_5_0_,
            (select
                count(1) 
            from
                post_tag posttag1_ 
            inner join
                post post2_ 
                    on (
                        post2_.id=posttag1_.post_id
                    ) 
            where
                posttag1_.tag_id=tag0_.id 
                and post2_.enabled=? 
                and post2_.deleted=?) as col_6_0_ 
        from
            tag tag0_ 
        where
            tag0_.id=?
    2022-12-23 17:59:46.772  INFO 13964 --- [           main] example.text.ExampleApplicationTest      : tuple:null
    

    Thanks.

    bug 
    opened by KevinBlandy 0
  • How to use kotlin custom getter in Qfile?

    How to use kotlin custom getter in Qfile?

    Why the new feature should be added

    Jpa Entitiy has many custom getter. this property is not database column. therefore i have to write same code in Jpa Entity and Qfile.

    jpa entity

    @Entity
    class BillMaster(
        val priceA: Long,
        val priceB: Long
    ) {
        val totalPrice
            get() = priceA + priceB
    }
    

    queryDsl Qfile

    val QBillMaster.totalPrice: NumberExpression<Long>
            get() =
                this.priceA
                    .add(this.priceB)
    

    How can I merge duplicate code in entity and qfile?

    How the new feature should work

    opened by bingbingpa 0
  • Bump spring-jdbc from 5.3.19 to 6.0.3

    Bump spring-jdbc from 5.3.19 to 6.0.3

    Bumps spring-jdbc from 5.3.19 to 6.0.3.

    Release notes

    Sourced from spring-jdbc's releases.

    v6.0.3

    :star: New Features

    • Throw PessimisticLockingFailureException/CannotAcquireLockException instead of plain ConcurrencyFailureException #29675
    • Introduce additional constructors in MockClientHttpRequest and MockClientHttpResponse #29670
    • Fall back to JdkClientHttpConnector as ClientHttpConnector #29645
    • Optimize object creation in RequestMappingHandlerMapping#handleNoMatch #29634
    • Align multipart codecs on client and server #29630
    • Deprecate "application/graphql+json" media type after spec changes #29617
    • HTTP interface client does not call FormHttpMessageWriter when writing form data #29615
    • ProblemDetail doesn't override the equals method #29606
    • Add title to SockJS iFrames for accessibility compliance #29594
    • Forbid loading of a test's ApplicationContext in AOT mode if AOT processing failed #29579
    • Deprecate JettyWebSocketClient in favor of StandardWebSocketClient #29576
    • Improve options to expose MessageSource formatted errors for a ProblemDetail response #29574
    • Make @ModelAttribute and @InitBinder annotations @Reflective #29572
    • Update BindingReflectionHintsRegistrar to support properties on records #29571

    :lady_beetle: Bug Fixes

    • Cannot use WebDAV methods in Spring MVC 6.0 anymore #29689
    • AnnotatedElementUtils.findMergedRepeatableAnnotations does not fetch results when other attributes exist in container annotation #29685
    • BeanWrapperImpl NPE in setWrappedInstance after invoking getPropertyValue #29681
    • SpEL ConstructorReference does not generate AST representation of arrays #29665
    • NullPointerException in BindingReflectionHintsRegistrar for anonymous classes #29657
    • DataBufferInputStream violates InputStream contract #29642
    • Component scanning no longer uses component index for @Named, @ManagedBean, and other Jakarta annotations #29641
    • Fix canWrite in PartHttpMessageWriter #29631
    • NoHandlerFoundException mistakenly returns request headers from ErrorResponse#getHeaders #29626
    • URI override for @HttpExchange doesn't work if there are both URI and @PathVariable method parameters #29624
    • Unnecessary parameter name introspection for constructor-arg resolution (leading to LocalVariableTableParameterNameDiscoverer warnings) #29612
    • Set detail from reason in both constructors of ResponseStatusException #29608
    • SpEL string literal misses single quotation marks in toStringAST() #29604
    • AOT code generation fails for bean of type boolean #29598
    • request-scoped bean with @Lazy fails in native image (due to missing detection of CGLIB lazy resolution proxies) #29584
    • 500 error from WebFlux when parsing Content-Type leads to InvalidMediaTypeException #29565
    • ConcurrentLruCache implementation is using too much heap memory #29520
    • Duplicate key violation gets translated to DataIntegrityViolationException instead of DuplicateKeyException in Spring 6 #29511
    • SpEL: Two double quotes are replaced by one double quote in single quoted String literal (and vice versa) #28356

    :notebook_with_decorative_cover: Documentation

    • Fix ErrorResponse#type documentation #29632
    • Fix typo in observability documentation #29590
    • Consistent documentation references to Jakarta WebSocket (2.1) #29581
    • Unrendered asciidoc headings in reference documentation #29569
    • Document observability support #29524

    :hammer: Dependency Upgrades

    ... (truncated)

    Commits
    • 0fbc94f Release v6.0.3
    • 6e08c56 Improve Javadoc for RepeatableContainers
    • fb6d3f5 Remove duplicated test code
    • 6fe5652 Support non-standard HTTP methods in FrameworkServlet
    • ca68bbc Upgrade to Reactor 2022.0.1
    • e7bcb48 Remove obsolete AttributeMethods.hasOnlyValueAttribute() method
    • 433b1c4 Support repeatable annotation containers with multiple attributes
    • 0b08246 Revise RepeatableContainersTests
    • c7bdfbe Add missing Javadoc
    • 618989d Update copyright date
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
Releases(QUERYDSL_5_0_0)
  • QUERYDSL_5_0_0(Jul 22, 2021)

    This release of QueryDSL targets Java 8 minimally and comes with various improvements to make QueryDSL ready for the modern Java ecosystem. This version also removes joda-time:joda-time, com.google.guava:guava and com.google.code.findbugs:jsr305 as required runtime dependencies for using QueryDSL.

    QueryDSL 5.0 is the long awaited major release after the QueryDSL project was left mostly unmaintained for over two years. With this release the team worked hard on resolving the most pressing issues that have been requested repeatedly for a long time.

    A huge thanks goes out to all contributors that made this release possible in their free time:

    New features

    • #2672 - Various performance and code improvements possible by targeting Java 8 source level.
    • #2672 - Added Fetchable#stream() which returns a Stream<T>. Make sure that the returned stream is always closed to free up resources, for example using try-with-resources. It does not suffice to rely on a terminating operation on the stream for this (i.e. forEach, collect).
    • #2324 - Removal of Guava as dependency. Almost no required transitive dependencies to get started with QueryDSL. And no more conflicts with Guava versions required by your other tools or own application.
    • #2025 - joda-time:joda-time is no longer a required dependency for querydsl-sql. By default, the Java 8 date/time API is used for date/time operations. The joda-time:joda-time types will still be registered automatically if they are on the classpath.
    • #2215 - MongoDB 4 support through the Document API
    • #2697 - Allow com.querydsl.core.alias.Alias.* to be used on a JRE by relying on ECJ as compiler
    • #2479 - Swap out JSR305 for Jetbrains Annotations. Because the Jetbrains Annotations, contrary to the JSR305 annotations, use a Class retention level, Jetbrains Annotations does not have to be available at runtime and is not a transitive dependency.
    • #658 - Added JPAExpressions#treat which can be used to generate JPA 2.1 Treated path expressions.
    • #2666 - More descriptive error message when using unsupported query features in JPA.
    • #2106 - Support NullsLast ordering in querydsl-collections.
    • #2404 - Upgrade of JTS / Geolatte in querydsl-spatial
    • #2320 - Make Spatial support available to HibernateDomainExporter and JPADomainExporter.
    • #2612 - Support jakarta.* packages for new Jakarta EE releases (available through thejakarta classifiers for Maven)
    • #1376 - Return typed expression from nullif and coalesce methods.
    • #1828 - Kotlin Codegen support
    • #2798 - Java Record support

    Bugfixes

    • #2579 - Count query generation in JPASQLQuery
    • #2671 - Fixed a concurrency issue in Alias.*. Alias.* is now Thread safe.
    • #2053 - Work around issues with AbstractJPAQuery#fetchResults and AbstractJPAQuery#fetchCount in a query with a having clause by using an in-memory calculation.
    • #2504 - Work around issues with AbstractJPAQuery#fetchResults and AbstractJPAQuery#fetchCount in a query with multiple group by expressions by using an in-memory calculation.
    • #2663 - Fix issues with the JPA implementation of InsertClause.
    • #2706 - Fix a memory leak in TemplateFactory.
    • #2467 - Prevent ExtendedBeanSerializer from generating toString method twice
    • #2326 - Use JPA indexed parameters instead of HQL's legacy positional parameters
    • #2816 - Generated JPA query with incorrect argument binding indexes
    • #1413 - Incorrect parameter values with Hibernate custom types
    • #1429 - Reusing of constants in JPQL generation causes issues with hibernate query caching

    Breaking changes

    • Java 8 minimal requirement. If you still rely on Java <7, please use the latest 4.x.x version.
    • JavaSE6SQLExceptionWrapper and other parts regarding pre-Java 7 exception handling are removed.
    • Removed bridge method that were in place for backwards compatibility of legacy API's. This may lead to some breaking API changes.
    • Removed Guava as a dependency. If your application relies on Guava, make sure to add it as a direct dependency for your project and not rely on QueryDSL shipping it transitively.
    • In order for Guava to be removed Mysema Codegen had to be rereleased as QueryDSL Codegen Utils. Therefore, the classes in this module moved to a different package: com.mysema.codegen is now com.querydsl.codegen.utils. This for example affects com.mysema.codegen.model.SimpleType. Although many applications won't touch the codgen internal classes, custom APT extensions might be affected by this.
    • Due to the removal of Guava, any method that received an ImmutableList as parameter, now accepts any List instead. Normal code should handle this signature just fine. However, make sure to check any reflective uses of these parameters.
    • The querydsl.variableNameFunctionClass property for the DefaultConfiguration should now be provided as a java.util.function.Function instead of a com.google.common.base.Function.
    • CodeWriter#beginStaticMethod now takes a java.util.function.Function instead of a com.google.common.base.Function.
    • AbstractLuceneQuery now takes a java.util.function.Function instead of a com.google.common.base.Function.
    • AbstractMongodbQuery now takes a java.util.function.Function instead of a com.google.common.base.Function.
    • com.querydsl.codegen.NamingFunction, EvaluatorFunction, DefaultVariableFunction now extend java.util.function.Function instead of com.google.common.base.Function.
    • Any constructor that received a javax.inject.Provider, now takes a java.util.function.Supplier instead. In most cases you can replace the argument with provider::get.
    • This release targets Hibernate 5.2 in the Hibernate integration. If you need Hibernate 4 dialect specific workarounds, use the HQLTemplates instead of the Hibernate5Templates.
    • Removal of various deprecated methods.
    • joda-time:joda-time is now an optional dependency. If your application relies on joda-time:joda-time make sure to specify it as a direct dependency rather than relying on QueryDSL to include it transitively.
    • com.google.code.findbugs:jsr305 is no longer a dependency. If your application currently relies on QueryDSL shipping JSR305 transitively, you should add JSR305 as a direct dependency to your project.
    • MDC keys now use an underscore instead of a dot as separator: querydsl.query now is querydsl_query and querydsl.parameters is querydsl_parameters.
    • Removal of PolyHedralSurface in querydsl-spatial and querydsl-sql-spatial due to the upgrade of geolatte-geom.
    • com.querydsl.apt.Extension moved to com.querydsl.codegen and now resides in the querydsl-codegen module.
    • com.querydsl.apt.SpatialSupport moved to com.querydsl.spatial.apt.SpatialSupport and now resides in the querydsl-spatial module.
    • com.querydsl.sql.codegen.SpatialSupport moved to com.querydsl.sql.spatial.SpatialSupport and now resides in the querydsl-sql-spatial module.
    • SQLServerGeometryReader in querydsl-sql-spatial is removed in favour of org.geolatte.geom.codec.db.sqlserver.*.
    • PGgeometryConverter in querydsl-sql-spatial is removed in favour of org.geolatte.geom.codec.Wkt.
    • JGeometryConverter in querydsl-sql-spatial is removed in favour of org.geolatte.geom.codec.db.oracle.*.
    • Removal of HibernateDomainExporter in querysql-jpa-codegen. HibernateDomainExporter only supported Hibernate 4, which QueryDSL no longer actively supports. Instead, use the JPADomainExporter with Hibernate.
    • ComparableExpression#coalesce (and subtypes) no longer return a mutable Coalesce expression, but instead return a typed expression. If you need the Coalesce builder, use new Coalesce<T>().add(expression) instead.
    • getConstantToNamedLabel, getConstantToNumberedLabel and getConstantToAllLabels that were temporarily introduced to SerializerBase and JPQLSerializer in QueryDSL 4.3.0 to eventually replace getConstantToLabel are now removed in favor of getConstants.
    • OSGi data is not included in the manifest anymore

    Deprecations

    • AbstractJPAQuery#fetchResults and AbstractJPAQuery#fetchCount are now deprecated for queries that have multiple group by expressions or a having clause, because these scenarios cannot be supported by pure JPA and are instead computed in-memory. If the total count of results is not necessary, we recommend to always use AbstractJPAQuery#fetch instead. If you want a reliable way of computing the result count for a paginated result for even the most complicated queries, we recommend using the Blaze-Persistence QueryDSL integration. BlazeJPAQuery properly implements both fetchResults and fetchCount and even comes with a page method.
    • getConstantToLabel which was deprecated in QueryDSL 4.3.0 is no longer deprecated.

    Dependency updates

    • cglib:cglib to 3.3.0 for Java 8+ support
    • org.eclipse.jdt.core.compiler:ecj to 4.6.1 for Java 8+ support
    • joda-time:joda-time to 2.10.10 for better interoperability with other frameworks that use more recent versions than QueryDSL. joda-time:joda-time is also no longer a required dependency and as such is no longer provided transitively to your application. If your application relies on joda-time:joda-time being available, make sure to add the dependency to your project.
    • org.geolatte:geolatte-geom to 1.8.1 for better interopability with Hibernate Spatial. querydsl-spatial is still backwards compatible with older versions of Geolatte, however, querydsl-sql-spatial is not and requires 1.4.0 or newer.
    • com.vividsolutions:jts to org.locationtech:jts for better interopability with Hibernate Spatial. com.vividsolutions:jts is still supported for querydsl-spatial if an older version of org.geolatte:geolatte-geom is provided.
    • DataNucleus 5.2.x for Java 8+ support
      • JDO now uses org.datanucleus:javax.jdo instead of javax.jdo:jdo-api
    • com.google.guava:guava is no longer a dependency of QueryDSL and as such is no longer provided transitively to your application. If your application relies on com.google.guava:guava being available, make sure to add the dependency to your project.
    • com.google.code.findbugs:jsr305 is no longer a dependency of QueryDSL and as such is no longer provided transitively to your application. If your application relies on com.google.code.findbugs:jsr305 being available, make sure to add the dependency to your project.
    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_5_0_0_M1(Jun 16, 2021)

    This release of QueryDSL targets Java 8 minimally and comes with various improvements to make QueryDSL ready for the modern Java ecosystem. This version also removes joda-time:joda-time, com.google.guava:guava and com.google.code.findbugs:jsr305 as required runtime dependencies for using QueryDSL.

    QueryDSL 5.0 is the long awaited major release after the QueryDSL project was left mostly unmaintained for over two years. With this release the team worked hard on resolving the most pressing issues that have been requested repeatedly for a long time.

    A huge thanks goes out to all contributors that made this release possible in their free time:

    New features

    • #2672 - Various performance and code improvements possible by targeting Java 8 source level.
    • #2672 - Added Fetchable#stream() which returns a Stream<T>. Make sure that the returned stream is always closed to free up resources, for example using try-with-resources. It does not suffice to rely on a terminating operation on the stream for this (i.e. forEach, collect).
    • #2324 - Removal of Guava as dependency. Almost no required transitive dependencies to get started with QueryDSL. And no more conflicts with Guava versions required by your other tools or own application.
    • #2025 - joda-time:joda-time is no longer a required dependency for querydsl-sql. By default, the Java 8 date/time API is used for date/time operations. The joda-time:joda-time types will still be registered automatically if they are on the classpath.
    • #2215 - MongoDB 4 support through the Document API
    • #2697 - Allow com.querydsl.core.alias.Alias.* to be used on a JRE by relying on ECJ as compiler
    • #2479 - Swap out JSR305 for Jetbrains Annotations. Because the Jetbrains Annotations, contrary to the JSR305 annotations, use a Class retention level, Jetbrains Annotations does not have to be available at runtime and is not a transitive dependency.
    • #658 - Added JPAExpressions#treat which can be used to generate JPA 2.1 Treated path expressions.
    • #2666 - More descriptive error message when using unsupported query features in JPA.
    • #2106 - Support NullsLast ordering in querydsl-collections.
    • #2404 - Upgrade of JTS / Geolatte in querydsl-spatial
    • #2320 - Make Spatial support available to HibernateDomainExporter and JPADomainExporter.
    • #2612 - Support jakarta.* packages for new Jakarta EE releases (available through thejakarta classifiers for Maven)
    • #1376 - Return typed expression from nullif and coalesce methods.
    • #1828 - Kotlin Codegen support
    • #2798 - Java Record support

    Bugfixes

    • #2579 - Count query generation in JPASQLQuery
    • #2671 - Fixed a concurrency issue in Alias.*. Alias.* is now Thread safe.
    • #2053 - Work around issues with AbstractJPAQuery#fetchResults and AbstractJPAQuery#fetchCount in a query with a having clause by using an in-memory calculation.
    • #2504 - Work around issues with AbstractJPAQuery#fetchResults and AbstractJPAQuery#fetchCount in a query with multiple group by expressions by using an in-memory calculation.
    • #2663 - Fix issues with the JPA implementation of InsertClause.
    • #2706 - Fix a memory leak in TemplateFactory.
    • #2467 - Prevent ExtendedBeanSerializer from generating toString method twice
    • #2326 - Use JPA indexed parameters instead of HQL's legacy positional parameters
    • #2816 - Generated JPA query with incorrect argument binding indexes
    • #1413 - Incorrect parameter values with Hibernate custom types
    • #1429 - Reusing of constants in JPQL generation causes issues with hibernate query caching

    Breaking changes

    • Java 8 minimal requirement. If you still rely on Java <7, please use the latest 4.x.x version.
    • JavaSE6SQLExceptionWrapper and other parts regarding pre-Java 7 exception handling are removed.
    • Removed bridge method that were in place for backwards compatibility of legacy API's. This may lead to some breaking API changes.
    • Removed Guava as a dependency. If your application relies on Guava, make sure to add it as a direct dependency for your project and not rely on QueryDSL shipping it transitively.
    • In order for Guava to be removed Mysema Codegen had to be rereleased as QueryDSL Codegen Utils. Therefore, the classes in this module moved to a different package: com.mysema.codegen is now com.querydsl.codegen.utils. This for example affects com.mysema.codegen.model.SimpleType. Although many applications won't touch the codgen internal classes, custom APT extensions might be affected by this.
    • Due to the removal of Guava, any method that received an ImmutableList as parameter, now accepts any List instead. Normal code should handle this signature just fine. However, make sure to check any reflective uses of these parameters.
    • The querydsl.variableNameFunctionClass property for the DefaultConfiguration should now be provided as a java.util.function.Function instead of a com.google.common.base.Function.
    • CodeWriter#beginStaticMethod now takes a java.util.function.Function instead of a com.google.common.base.Function.
    • AbstractLuceneQuery now takes a java.util.function.Function instead of a com.google.common.base.Function.
    • AbstractMongodbQuery now takes a java.util.function.Function instead of a com.google.common.base.Function.
    • com.querydsl.codegen.NamingFunction, EvaluatorFunction, DefaultVariableFunction now extend java.util.function.Function instead of com.google.common.base.Function.
    • Any constructor that received a javax.inject.Provider, now takes a java.util.function.Supplier instead. In most cases you can replace the argument with provider::get.
    • This release targets Hibernate 5.2 in the Hibernate integration. If you need Hibernate 4 dialect specific workarounds, use the HQLTemplates instead of the Hibernate5Templates.
    • Removal of various deprecated methods.
    • joda-time:joda-time is now an optional dependency. If your application relies on joda-time:joda-time make sure to specify it as a direct dependency rather than relying on QueryDSL to include it transitively.
    • com.google.code.findbugs:jsr305 is no longer a dependency. If your application currently relies on QueryDSL shipping JSR305 transitively, you should add JSR305 as a direct dependency to your project.
    • MDC keys now use an underscore instead of a dot as separator: querydsl.query now is querydsl_query and querydsl.parameters is querydsl_parameters.
    • Removal of PolyHedralSurface in querydsl-spatial and querydsl-sql-spatial due to the upgrade of geolatte-geom.
    • com.querydsl.apt.Extension moved to com.querydsl.codegen and now resides in the querydsl-codegen module.
    • com.querydsl.apt.SpatialSupport moved to com.querydsl.spatial.apt.SpatialSupport and now resides in the querydsl-spatial module.
    • com.querydsl.sql.codegen.SpatialSupport moved to com.querydsl.sql.spatial.SpatialSupport and now resides in the querydsl-sql-spatial module.
    • SQLServerGeometryReader in querydsl-sql-spatial is removed in favour of org.geolatte.geom.codec.db.sqlserver.*.
    • PGgeometryConverter in querydsl-sql-spatial is removed in favour of org.geolatte.geom.codec.Wkt.
    • JGeometryConverter in querydsl-sql-spatial is removed in favour of org.geolatte.geom.codec.db.oracle.*.
    • Removal of HibernateDomainExporter in querysql-jpa-codegen. HibernateDomainExporter only supported Hibernate 4, which QueryDSL no longer actively supports. Instead, use the JPADomainExporter with Hibernate.
    • ComparableExpression#coalesce (and subtypes) no longer return a mutable Coalesce expression, but instead return a typed expression. If you need the Coalesce builder, use new Coalesce<T>().add(expression) instead.
    • getConstantToNamedLabel, getConstantToNumberedLabel and getConstantToAllLabels that were temporarily introduced to SerializerBase and JPQLSerializer in QueryDSL 4.3.0 to eventually replace getConstantToLabel are now removed in favor of getConstants.

    Deprecations

    • AbstractJPAQuery#fetchResults and AbstractJPAQuery#fetchCount are now deprecated for queries that have multiple group by expressions or a having clause, because these scenarios cannot be supported by pure JPA and are instead computed in-memory. If the total count of results is not necessary, we recommend to always use AbstractJPAQuery#fetch instead. If you want a reliable way of computing the result count for a paginated result for even the most complicated queries, we recommend using the Blaze-Persistence QueryDSL integration. BlazeJPAQuery properly implements both fetchResults and fetchCount and even comes with a page method.
    • getConstantToLabel which was deprecated in QueryDSL 4.3.0 is no longer deprecated.

    Dependency updates

    • cglib:cglib to 3.3.0 for Java 8+ support
    • org.eclipse.jdt.core.compiler:ecj to 4.6.1 for Java 8+ support
    • joda-time:joda-time to 2.10.10 for better interoperability with other frameworks that use more recent versions than QueryDSL. joda-time:joda-time is also no longer a required dependency and as such is no longer provided transitively to your application. If your application relies on joda-time:joda-time being available, make sure to add the dependency to your project.
    • org.geolatte:geolatte-geom to 1.8.1 for better interopability with Hibernate Spatial. querydsl-spatial is still backwards compatible with older versions of Geolatte, however, querydsl-sql-spatial is not and requires 1.4.0 or newer.
    • com.vividsolutions:jts to org.locationtech:jts for better interopability with Hibernate Spatial. com.vividsolutions:jts is still supported for querydsl-spatial if an older version of org.geolatte:geolatte-geom is provided.
    • DataNucleus 5.2.x for Java 8+ support
      • JDO now uses org.datanucleus:javax.jdo instead of javax.jdo:jdo-api
    • com.google.guava:guava is no longer a dependency of QueryDSL and as such is no longer provided transitively to your application. If your application relies on com.google.guava:guava being available, make sure to add the dependency to your project.
    • com.google.code.findbugs:jsr305 is no longer a dependency of QueryDSL and as such is no longer provided transitively to your application. If your application relies on com.google.code.findbugs:jsr305 being available, make sure to add the dependency to your project.
    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_4_0(Sep 19, 2020)

  • QUERYDSL_4_3_1(Jul 15, 2020)

  • QUERYDSL_4_2_2(Nov 23, 2019)

  • QUERYDSL_4_2_1(Mar 22, 2018)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A4.2.1

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.2.1 Reference docs : http://www.querydsl.com/static/querydsl/4.2.1/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.2.1/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_2_0(Mar 22, 2018)

  • QUERYDSL_4_1_4(Sep 5, 2016)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A4.1.4

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.1.4 Reference docs : http://www.querydsl.com/static/querydsl/4.1.4/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.1.4/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_1_3(Jul 1, 2016)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A4.1.3

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.1.3 Reference docs : http://www.querydsl.com/static/querydsl/4.1.3/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.1.3/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_3_7_4(Jul 1, 2016)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A3.7.4

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/3.7.4 Reference docs : http://www.querydsl.com/static/querydsl/3.7.4/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/3.7.4/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_1_2(May 31, 2016)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A4.1.2

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.1.2 Reference docs : http://www.querydsl.com/static/querydsl/4.1.2/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.1.2/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_1_1(May 16, 2016)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A4.1.1

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.1.1 Reference docs : http://www.querydsl.com/static/querydsl/4.1.1/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.1.1/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_3_7_3(May 16, 2016)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A3.7.3

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/3.7.3 Reference docs : http://www.querydsl.com/static/querydsl/3.7.3/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/3.7.3/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_1_0(Apr 1, 2016)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A4.1.0

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.1.0 Reference docs : http://www.querydsl.com/static/querydsl/4.1.0/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.1.0/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_0_9(Feb 29, 2016)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A4.0.9

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.0.9 Reference docs : http://www.querydsl.com/static/querydsl/4.0.9/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.0.9/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_3_7_2(Feb 29, 2016)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A3.7.2

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/3.7.2 Reference docs : http://www.querydsl.com/static/querydsl/3.7.2/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/3.7.2/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_0_8(Jan 31, 2016)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A4.0.8

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.0.8 Reference docs : http://www.querydsl.com/static/querydsl/4.0.8/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.0.8/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_3_7_1(Jan 31, 2016)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A3.7.1

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/3.7.1 Reference docs : http://www.querydsl.com/static/querydsl/3.7.1/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/3.7.1/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_0_7(Dec 1, 2015)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A4.0.7

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.0.7 Reference docs : http://www.querydsl.com/static/querydsl/4.0.7/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.0.7/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_3_7_0(Dec 1, 2015)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A3.7.0

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/3.7.0 Reference docs : http://www.querydsl.com/static/querydsl/3.7.0/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/3.7.0/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_0_6(Oct 31, 2015)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A4.0.6

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.0.6 Reference docs : http://www.querydsl.com/static/querydsl/4.0.6/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.0.6/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_3_6_9(Oct 31, 2015)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A3.6.9

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/3.6.9 Reference docs : http://www.querydsl.com/static/querydsl/3.6.9/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/3.6.9/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_0_5(Oct 1, 2015)

    Fixes issues https://github.com/querydsl/querydsl/issues?q=milestone%3A4.0.5

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.0.5 Reference docs : http://www.querydsl.com/static/querydsl/4.0.5/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.0.5/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_3_6_8(Oct 1, 2015)

    Fixed issues https://github.com/querydsl/querydsl/issues?q=milestone%3A3.6.8

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/3.6.8 Reference docs : http://www.querydsl.com/static/querydsl/3.6.8/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/3.6.8/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_0_4(Sep 1, 2015)

    JPA

    • JPQLQuery loses nulls last/first for nested properties https://github.com/querydsl/querydsl/issues/1503
    • ArrayIndexOutOfBoundsException when using FactoryExpressionBase.skipNulls() https://github.com/querydsl/querydsl/issues/1496
    • JPAQueryFactory methods with varargs EntityPath https://github.com/querydsl/querydsl/issues/1474
    • fetchResults() generating wrong count query https://github.com/querydsl/querydsl/issues/1472
    • HibernateDomainExporter and inheritance with composite-id https://github.com/querydsl/querydsl/issues/1459
    • CaseForEqBuilder generates SimpleOperation instead of concrete type https://github.com/querydsl/querydsl/issues/1253

    SQL

    • QueryDSL-SQL Generates Bad Query With Oracle, CTE's and limit() https://github.com/querydsl/querydsl/issues/1487
    • AntMetaDataExporter Defaults Incorrect https://github.com/querydsl/querydsl/issues/1483
    • Insert operation doesn't fire listener executed() for non-batch operations https://github.com/querydsl/querydsl/issues/1479
    • SQLQueryFactory doesn't release connection / leak https://github.com/querydsl/querydsl/issues/1476
    • MetadataExporter should provide option to override output schema

    JDO

    • Wrong query is generated for concat statement https://github.com/querydsl/querydsl/issues/1482

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.0.4 Reference docs : http://www.querydsl.com/static/querydsl/4.0.4/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.0.4/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_3_6_7(Sep 1, 2015)

    JPA

    • Fix FactoryExpressionTransformer https://github.com/querydsl/querydsl/issues/1496
    • Fix NullHandling treatment https://github.com/querydsl/querydsl/issues/1503

    SQL

    • Improve CTE serialization https://github.com/querydsl/querydsl/issues/1487
    • Add support for PostgreSQL specific DISTINCT ON https://github.com/querydsl/querydsl/pull/1489

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/3.6.7 Reference docs : http://www.querydsl.com/static/querydsl/3.6.7/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/3.6.7/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_0_3(Aug 1, 2015)

    SQL

    • Add StatementOptions https://github.com/querydsl/querydsl/issues/1419
    • sqlQuery.forUpdate() does not work on SQLServer https://github.com/querydsl/querydsl/issues/1446
    • SQLQueryFactory .list() with offset and limit causes SQLSyntaxErrorException in Oracle11g https://github.com/querydsl/querydsl/issues/1445

    JPA

    • Weird Behavior for byte[] array in Hibernate Objects https://github.com/querydsl/querydsl/issues/1431

    Mongodb

    • Fix alias serialization for MongoDB https://github.com/querydsl/querydsl/issues/1427
    • Add support for $nearSphere https://github.com/querydsl/querydsl/issues/1438

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.0.3 Reference docs : http://www.querydsl.com/static/querydsl/4.0.3/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.0.3/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_3_6_6(Aug 1, 2015)

    SQL

    • Add StatementOptions https://github.com/querydsl/querydsl/issues/1419

    Mongodb

    • Fix alias serialization for MongoDB https://github.com/querydsl/querydsl/issues/1427
    • Add support for $nearSphere https://github.com/querydsl/querydsl/issues/1438

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/3.6.6 Reference docs : http://www.querydsl.com/static/querydsl/3.6.6/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/3.6.6/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_4_0_2(Jun 30, 2015)

    General

    • BeanPath.casts should be made safe for concurrent usage https://github.com/querydsl/querydsl/issues/1403

    SQL

    • Rename Union.list() to fetch https://github.com/querydsl/querydsl/issues/1414
    • Connection pooling does not appear to be correctly supported https://github.com/querydsl/querydsl/issues/1254

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/4.0.2 Reference docs : http://www.querydsl.com/static/querydsl/4.0.2/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/4.0.2/apidocs/

    Source code(tar.gz)
    Source code(zip)
  • QUERYDSL_3_6_5(Jun 30, 2015)

    General

    • BeanPath.casts should be made safe for concurrent usage #1403
    • 3.6.4 silently requires new Hibernate version https://github.com/querydsl/querydsl/issues/1406

    Download for non-Maven users : http://www.querydsl.com/static/querydsl/3.6.5 Reference docs : http://www.querydsl.com/static/querydsl/3.6.5/reference/html/ Javadoc API : http://www.querydsl.com/static/querydsl/3.6.5/apidocs/

    Source code(tar.gz)
    Source code(zip)
jdbi is designed to provide convenient tabular data access in Java; including templated SQL, parameterized and strongly typed queries, and Streams integration

The Jdbi library provides convenient, idiomatic access to relational databases in Java. Jdbi is built on top of JDBC. If your database has a JDBC driv

null 1.7k Dec 27, 2022
H2 is an embeddable RDBMS written in Java.

Welcome to H2, the Java SQL database. The main features of H2 are: Very fast, open source, JDBC API Embedded and server modes; disk-based or in-memory

H2 Database Engine 3.6k Jan 5, 2023
A blazingly small and sane redis java client

Jedis Jedis is a blazingly small and sane Redis java client. Jedis was conceived to be EASY to use. Jedis is fully compatible with redis 2.8.x, 3.x.x

Redis 10.8k Dec 31, 2022
Elasticsearch Java Rest Client.

JEST Jest is a Java HTTP Rest client for ElasticSearch. ElasticSearch is an Open Source (Apache 2), Distributed, RESTful, Search Engine built on top o

Searchly 2.1k Jan 1, 2023
Java binding for etcd

jetcd: Java binding for etcd TravisCI: CircleCI: A simple Java client library for the awesome etcd Uses the Apache HttpAsyncClient to implement watche

Justin Santa Barbara 134 Jan 26, 2022
MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.

MapDB: database engine MapDB combines embedded database engine and Java collections. It is free under Apache 2 license. MapDB is flexible and can be u

Jan Kotek 4.6k Dec 30, 2022
MariaDB Embedded in Java JAR

What? MariaDB4j is a Java (!) "launcher" for MariaDB (the "backward compatible, drop-in replacement of the MySQL(R) Database Server", see FAQ and Wiki

Michael Vorburger ⛑️ 720 Jan 4, 2023
requery - modern SQL based query & persistence for Java / Kotlin / Android

A light but powerful object mapping and SQL generator for Java/Kotlin/Android with RxJava and Java 8 support. Easily map to or create databases, perfo

requery 3.1k Jan 5, 2023
Speedment is a Stream ORM Java Toolkit and Runtime

Java Stream ORM Speedment is an open source Java Stream ORM toolkit and runtime. The toolkit analyzes the metadata of an existing SQL database and aut

Speedment 2k Dec 21, 2022
A blazingly small and sane redis java client

Jedis Jedis is a blazingly small and sane Redis java client. Jedis was conceived to be EASY to use. Jedis is fully compatible with redis 2.8.x, 3.x.x

Redis 10.9k Jan 8, 2023
jOOQ is the best way to write SQL in Java

jOOQ's reason for being - compared to JPA Java and SQL have come a long way. SQL is an "ancient", yet established and well-understood technology. Java

jOOQ Object Oriented Querying 5.3k Jan 4, 2023
MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.

MapDB: database engine MapDB combines embedded database engine and Java collections. It is free under Apache 2 license. MapDB is flexible and can be u

Jan Kotek 4.6k Jan 1, 2023
Event capture and querying framework for Java

Eventsourcing for Java Enabling plurality and evolution of domain models Instead of mutating data in a database, Eventsourcing stores all changes (eve

Eventsourcing, Inc. 408 Nov 5, 2022
Java code generator for calling PL/SQL.

OBridge OBridge provides a simple Java source code generator for calling Oracle PL/SQL package procedures. Supported input, output parameters and retu

Ferenc Karsany 21 Oct 7, 2022
A zero ceremony ORM for Java

Release notes Welcome Persism is a wood simple, auto discovery, auto configuration, and convention over configuration ORM (Object Relational Mapping)

Dan Howard 121 Dec 17, 2022
A lightweight and performant Java ORM alternative.

LightORM A lightweight and performant Java ORM alternative. LightORM has annotation processors so that all the integration code with the database is g

Jailson Pereira 14 Nov 22, 2022
Java implementation of Condensation - a zero-trust distributed database that ensures data ownership and data security

Java implementation of Condensation About Condensation enables to build modern applications while ensuring data ownership and security. It's a one sto

CondensationDB 43 Oct 19, 2022