reforms / reforms Goto Github PK
View Code? Open in Web Editor NEWReforms is repository for framework that help in development with SQL and ORM technics
Reforms is repository for framework that help in development with SQL and ORM technics
При парсинге выражения
@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)
Иначе куча конструкций из Java не пашет.
Например сделать Iterable или Stream c помощью утилит.
Можно если не указана эта аннотация, по умолчанию использовать Enum.name() функцию, так как это ожидаемо.
Почему не ordinal? Потому что обратная функция для name() есть это valueOf, а для ordinal обратной функции нет, поэтому вообще лучше не рекомендовать пользователям использовать эту функцию у себя в коде.
Например у нас есть поле для IN запроса, в нем как могут быть данные так и не могут, сейчас если IN поле пустое вылетает ошибка.
То же самое касается следующих ситуаций, мне нужно по определенному флагу вставлять проверку или не вставлять. Как в такой ситуации писать код?
Если попробовать добавить 3й примитив boolean то вылетает ошибка.
Почему так?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.