Note that there are some explanatory texts on larger screens.

plurals
  1. POPlay Framework CRUD search issue
    text
    copied!<p>when trying a search on some entities in the CRUD module of Play I'm getting this exception:</p> <pre><code> play.exceptions.JavaExecutionException: org.hibernate.exception.SQLGrammarException: could not execute query at play.mvc.ActionInvoker.invoke(ActionInvoker.java:290) at Invocation.HTTP Request(Play!) Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1235) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1168) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:250) at play.db.jpa.JPAPlugin$JPAModelLoader.fetch(JPAPlugin.java:431) at controllers.CRUD$ObjectType.findPage(CRUD.java:253) at controllers.CRUD.list(CRUD.java:36) at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:413) at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:408) at play.mvc.ActionInvoker.invoke(ActionInvoker.java:182) ... 1 more Caused by: org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.loader.Loader.doList(Loader.java:2452) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2192) at org.hibernate.loader.Loader.list(Loader.java:2187) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:241) ... 7 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'CHARSET' in 'where clause' at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) at com.mysql.jdbc.Util.getInstance(Util.java:384) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2275) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208) at org.hibernate.loader.Loader.getResultSet(Loader.java:1869) at org.hibernate.loader.Loader.doQuery(Loader.java:718) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270) at org.hibernate.loader.Loader.doList(Loader.java:2449) ... 15 more </code></pre> <p>The odd thing is that search works for some entities and not for others. For example, for the following entity adding any string in the search box works:</p> <pre><code> @Entity public class Act extends Model { @Transient private static final int PAGE_SIZE = Integer.parseInt(Play.configuration.getProperty("pagination.size","10")); @Required(message = "act.name.required") public String name; @Required(message = "act.description.required") @Lob @MaxSize(value=500, message="act.description.maxsize") public String description; public Blob image; public boolean showInClosedMode; @Temporal(TemporalType.TIMESTAMP) public Date updated; @Required(message = "act.theatre.required") @ManyToOne public Theatre theatre; public boolean disabled; @OneToMany(mappedBy="act") public List&lt;Offer&gt; offers; @ManyToMany(cascade=CascadeType.PERSIST) public Set&lt;Tag&gt; tags; @Transient public String tagListSupport; [... some methods ...] } </code></pre> <p>But not for this one:</p> <pre><code>@Entity public class User extends Model { @Required(message = "user.name.required") public String name; @Email(message = "user.email.invalid") public String email; public String prefLang; public Long prefCity; public int credits; public Date lastLogin; @NoBinding("profile") public boolean disabled; @NoBinding("profile") public boolean admin; @NoBinding("profile") public boolean anonymous; @OneToMany(mappedBy = "owner") public List&lt;Ticket&gt; tickets; @ManyToMany public List&lt;Theatre&gt; theatres; public String googleId; public String yahooId; public String facebookId; public String twitterId; public String twitter_token; public String twitter_secret; public String username; public String password; @OneToMany(mappedBy = "user") public List&lt;Event&gt; history; [...Methods...] } </code></pre> <p>Any idea why this happens?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload