Giter VIP home page Giter VIP logo

reforms's People

Contributors

ilia-dolgopiatov-deel avatar torkhov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

reforms's Issues

Не парсит выражение IS NOT NULL

При парсинге выражения

@TargetQuery(
        query = "SELECT id, start_date, end_date, event_status, gosu_gamers_id, gosu_gamers_status, " +
                "contract_address, winner FROM match" +
                "WHERE event_status = :status AND start_date IS NOT NULL AND winner IS NOT NULL",
        orm = Match.class
)
List<Match> findByStatusAndStartDateIsNotNullAndWinnerIsNotNull(MatchStatus status) throws Exception;

Возникает ошибка:

java.lang.IllegalStateException: Не удалось до конца разобрать SELECT запрос. Позиция '137'. Номер строки '1'. Выражение 'SELECT id, start_date, end_date, event_status, gosu_gamers_id, gosu_gamers_status, contract_address, winner FROM matchWHERE event_status = :status AND start_date IS NOT NULL AND winner IS NOT NULL'. Текущий анализ остановлен на '= :status AND s...'
at com.reforms.sql.parser.SqlStream.createException(SqlStream.java:838)
at com.reforms.sql.parser.SqlStream.createException(SqlStream.java:814)
at com.reforms.sql.parser.SqlStream.createException(SqlStream.java:810)
at com.reforms.sql.parser.SqlParser.parseSelectQuery(SqlParser.java:60)
at com.reforms.orm.dao.OrmDao.parseSelectQuery(OrmDao.java:428)
at com.reforms.orm.dao.OrmDao.loads(OrmDao.java:61)
at com.reforms.orm.dao.OrmDaoAdapter.loads(OrmDaoAdapter.java:405)
at com.reforms.orm.dao.proxy.DaoProxy.processSelectQuery(DaoProxy.java:156)
at com.reforms.orm.dao.proxy.DaoProxy.invoke(DaoProxy.java:80)
at com.sun.proxy.$Proxy69.findByStatusAndStartDateIsNotNullAndWinnerIsNotNull(Unknown Source)
at ru.smartbet.webapp.service.MatchStatusSyncService.updatePending(MatchStatusSyncService.java:73)
at ru.smartbet.webapp.service.MatchStatusSyncService$$FastClassBySpringCGLIB$$a2208802.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at ru.smartbet.webapp.service.MatchStatusSyncService$$EnhancerBySpringCGLIB$$cdbe8a59.updatePending()
at ru.smartbet.webapp.scheduler.Scheduler.updatePending(Scheduler.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

@TargetMethod в enum

Можно если не указана эта аннотация, по умолчанию использовать Enum.name() функцию, так как это ожидаемо.
Почему не ordinal? Потому что обратная функция для name() есть это valueOf, а для ordinal обратной функции нет, поэтому вообще лучше не рекомендовать пользователям использовать эту функцию у себя в коде.

Как работать с динамическими запросами?

Например у нас есть поле для IN запроса, в нем как могут быть данные так и не могут, сейчас если IN поле пустое вылетает ошибка.
То же самое касается следующих ситуаций, мне нужно по определенному флагу вставлять проверку или не вставлять. Как в такой ситуации писать код?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.