Причинено от: java.util.regex.PatternSyntaxException: Незаконно повторение

Опитвам се да получа заявка за търсене и да предавам параметри в заявката за търсене (неговата шифрована заявка с оператор like) и да предавам динамичния параметър, но получавам грешка. Нео4j проблем ли е проблемът с Regex.

    Map<String, Object> map = new HashMap<String, Object>();
            map.put(parameter, groupIdAfterSubstituet(collabVo));//
            map.put("{display_name}",input);//input="S"
    Result<Map<String, Object>> result = neoOperation.query(
                    collabVo.getSearchQuery(), map);//MATCH (n:OrganizationUnit {id:{class}})-[r:PART]-(c)-[r1:STUDENTROLE]-(f) where f.firstName =~"{display_name}.*" RETURN f
            Result<Student> std = result.to(Student.class);
            for (Student st : std) {
                students.add(st);

Грешка

[STDERR] javax.el.ELException: /sections/content/postAlertContent.xhtml @28,38 completeMethod="#         {autocompleteBeanController.completeUserProfile}": java.util.regex.PatternSyntaxException: Illegal    repetition
[STDERR] {display_name}.*
[STDERR]    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:111)
[STDERR]    at   org.primefaces.component.autocomplete.AutoComplete.broadcast(AutoComplete.java:337)
[STDERR]    at javax.faces.component.UIData.broadcast(UIData.java:1093)
[STDERR]    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
[STDERR]    at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:935)
[STDERR]    at  com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
[STDERR]    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
[STDERR]    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) 
[STDERR]    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
[STDERR]    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1329) 
[STDERR]    at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:98)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
[STDERR]    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) 
[STDERR]    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
[STDERR]    at com.ramselabs.education.filter.LoginFilter.doFilter(LoginFilter.java:52)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445)
[STDERR]    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
[STDERR]    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)
[STDERR]    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
[STDERR]    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)
[STDERR]    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
[STDERR]    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)
[STDERR]    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
[STDERR]    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
[STDERR]    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
[STDERR]    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
[STDERR]    at org.eclipse.jetty.server.Server.handle(Server.java:363)
[STDERR]    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)  
[STDERR]    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:931)
[STDERR]    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:992)
[STDERR]    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
[STDERR]    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
[STDERR]    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
[STDERR]    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
[STDERR]    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
[STDERR]    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
[STDERR]    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
[STDERR]    at java.lang.Thread.run(Thread.java:745)
[STDERR] Caused by: java.util.regex.PatternSyntaxException: Illegal repetition
[STDERR] {display_name}.*
[STDERR]    at java.util.regex.Pattern.error(Pattern.java:1924)
[STDERR]    at java.util.regex.Pattern.closure(Pattern.java:3104)
[STDERR]    at java.util.regex.Pattern.sequence(Pattern.java:2101)
[STDERR]    at java.util.regex.Pattern.expr(Pattern.java:1964)
[STDERR]    at java.util.regex.Pattern.compile(Pattern.java:1665)
[STDERR]    at java.util.regex.Pattern.<init>(Pattern.java:1337)
[STDERR]    at java.util.regex.Pattern.compile(Pattern.java:1022)
[STDERR]    at scala.util.matching.Regex.<init>(Regex.scala:153)

person user3011731    schedule 02.12.2014    source източник


Отговори (1)


Проблемът не беше в модела. Проблемът беше в моята cypher заявка. Cypher заявката трябва да бъде така:

MATCH (n:OrganizationUnit {id:{class}})-[r:PART]-(c)-[r1:STUDENTROLE]-(f) 
where f.firstName =~{display_name} RETURN f

И добавянето на параметри трябва да бъде така:

map.put("display_name", input);  

където input съдържа пълния модел (като "nameToMatch.*"). Това трябва да работи.

person user3011731    schedule 04.12.2014