public static void profile(Profile profile){
.....
}
play.exceptions.UnexpectedException: Unexpected Errorat play.db.jpa.JPAPlugin.bind(JPAPlugin.java:66)at play.plugins.PluginCollection.bind(PluginCollection.java:534)at play.data.binding.Binder.bind(Binder.java:111)at play.mvc.ActionInvoker.getActionMethodArgs(ActionInvoker.java:642)at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:478)at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:473)at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161)at Invocation.HTTP Request(Play!)Caused by: java.lang.IllegalArgumentException: org.hibernate.QueryParameterException: Position beyond number of declared ordinal parameters. Remember that ordinal parameters are 1-based! Position: 2at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:440)at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:72)at play.db.jpa.JPAPlugin.bind(JPAPlugin.java:59)... 7 moreCaused by: org.hibernate.QueryParameterException: Position beyond number of declared ordinal parameters. Remember that ordinal parameters are 1-based! Position: 2at org.hibernate.engine.query.ParameterMetadata.getOrdinalParameterDescriptor(ParameterMetadata.java:81)at org.hibernate.engine.query.ParameterMetadata.getOrdinalParameterExpectedType(ParameterMetadata.java:87)at org.hibernate.impl.AbstractQueryImpl.determineType(AbstractQueryImpl.java:444)at org.hibernate.impl.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:416)at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:434)... 9 more
Could you please provide Profile class code?
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/Esfcfp49PI0J.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
Sorry for the late reply. I'm using the latest 1.2.x source code and I've managed to trace the source of the problem. It's from play.mvc.ActionInvoker#invoke. Params are merged at line 115 and merged again at line 161. This two merging returns a map with key "id" and values. ["1234","1234"], which should be only one value. Any idea? Thanks.
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/619Z9K6Pfk4J.
@Entity
@Table(name="EXAMPLE")
public class Example extends GenericModel {
@Id
@Required
public String code;
...
}
This is the controller.
public static void example(Example example) {
//do validation here
if(!validation.hasErrors()){
example.save();
}
render(example);
}
....
#{form @example().add('example.code', example?.code), enctype:'multipart/form-data'}
...
#{/form}
...