Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<EducationEvent> findUnaddedEducationEvents(Student student, List<EducationModule> educationModules,
- Education education) {
- TypedQuery<EducationEvent> query = entityManager.createQuery(
- "select distinct ee from EducationEvent ee left join ee.limitedScopeEducations lse "
- + "where ee.educationModule in (:em) "
- + "and (ee.scope = :publicScope "
- + "or (ee.scope = :limitedScope and (ee.hostEducation = :education or :education in lse)) "
- + "or (ee.scope = :localScope and ee.hostEducation = :education)) "
- + "and ee.status = :status and ee.startDate > :now "
- + "and (ee.groupSize = 0 or (ee.groupSize > 0 "
- + " and ee.groupSize > (ee.numberOfStudents + ee.reservedSeats))) "
- + "and ee.id not in (select pee.educationEvent.id from PersonalEducationEvent pee "
- + "where studentStatus.student = :s and educationEvent.educationModule in (:em))",
- EducationEvent.class);
- query.setParameter("s", student);
- query.setParameter("em", educationModules);
- query.setParameter("publicScope", PUBLIC);
- query.setParameter("limitedScope", LIMITED);
- query.setParameter("localScope", LOCAL);
- query.setParameter("education", education);
- query.setParameter("status", CONFIRMED);
- query.setParameter("now", new DateTime());
- return query.getResultList();
- 2017-10-19 14:46:32,673 [http-nio-8090-exec-10] WARN org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: 42601
- 2017-10-19 14:46:32,674 [http-nio-8090-exec-10] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - ERROR: syntax error at or near ")"
- Position: 1853
- lokakuuta 19, 2017 2:46:32 IP. org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver logException
- WARNING: Resolved exception caused by Handler execution: org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
- Data access failure
- Sorry, a problem occurred while accessing the database.
- org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:384)
- org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:246)
- org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:491)
- org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
- org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
- org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
- org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
- org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
- org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
- org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
- org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
- org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
- com.sun.proxy.$Proxy435.findUnaddedEducationEvents(Unknown Source)
Add Comment
Please, Sign In to add comment