====== Playframework bugs ====== ===== Play 1.2: call merge() save entity ===== 2011-04-15 public class Essais02 extends Controller { public static void index() { Logger.debug("Person count %d", Person.count()); Person p = new Person(); p.name = "blabla"; p.merge(); ... Voir: * Essais02 * [[http://groups.google.com/group/play-framework/browse_thread/thread/588faa1530d1b81a]] ===== Pas de gestion des violations d'intégrité ===== Les erreurs d'intégrité ne sont pas gérées par Play!, du coup il va falloir se les palucher à la mano !! **1.A l'effacement d'une valeur de catégorie référencée par une autre table:** 03:06:31,776 DEBUG ~ delete from CategoryValue where category_id=? 03:06:31,777 WARN ~ SQL Error: 23003, SQLState: 23003 03:06:31,777 ERROR ~ Referential integrity constraint violation: "FK4D440479B6C2B74C: PUBLIC.CATEGORYCOMBINAISONITEM FOREIGN KEY(CATEGORYVALUE_ID) REFERENCES PUBLIC.CATEGORYVALUE(ID)"; SQL statement: play.exceptions.JavaExecutionException: org.hibernate.exception.ConstraintViolationException: could not execute update query Caused by: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "FK4D440479B6C2B74C: PUBLIC.CATEGORYCOMBINAISONITEM FOREIGN KEY(CATEGORYVALUE_ID) REFERENCES PUBLIC.CATEGORYVALUE(ID)"; SQL statement: delete from CategoryValue where category_id=? [23003-149] **2.A l'insertion d'une valeur ayant le même code qu'une valeur existante:** 03:05:43,987 DEBUG ~ /* insert models.categories.CategoryValue */ insert into CategoryValue (category_id, code, id) values (?, ?, ?) 03:05:43,999 WARN ~ SQL Error: 23001, SQLState: 23001 03:05:43,999 ERROR ~ Unique index or primary key violation: "CONSTRAINT_INDEX_C ON PUBLIC.CATEGORYVALUE(CODE, CATEGORY_ID)"; SQL statement: /* insert models.categories.CategoryValue */ insert into CategoryValue (category_id, code, id) values (?, ?, ?) [23001-149] play.exceptions.JavaExecutionException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update Caused by: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "CONSTRAINT_INDEX_C ON PUBLIC.CATEGORYVALUE(CODE, CATEGORY_ID)"; SQL statement: /* insert models.categories.CategoryValue */ insert into CategoryValue (category_id, code, id) values (?, ?, ?) [23001-149] [[http://groups.google.com/group/play-framework/browse_thread/thread/da7c4f5ee9e53c17|HowTo make "user friendly" message when catching ConstraintViolationException ?]] ===== HowTo : UniqueConstraint and ManyToOne ===== A JPA error occurred (Unable to build EntityManagerFactory): @Column(s) not allowed on a @ManyToOne property: CategoryValue.category Ok, I understand that I can't naming the column for the ManyToOne relation, seems to be a JPA's rule, but how to implement the case ? Have you got a idea on how to get around ? [[http://groups.google.com/group/play-framework/browse_thread/thread/20b3ecc0b008a76f|HowTo : UniqueConstraint and ManyToOne]] Such a bad day ... The lesson is : **NEVER USE "hibernate.globally_quoted_identifiers=true" ** ===== feature request: 'anchor' option for tag "form" ===== 2011-04-13 [[http://play.lighthouseapp.com/projects/57987-play-framework/tickets/729|ticket #729]] ===== Validation entités sans id ===== 2011-04-13 [[http://play.lighthouseapp.com/projects/57987-play-framework/tickets/726|ticket #726]] Minimum size is 2 ( cv_0.code: Minimum size is 2 ) \\ Validation failed ( cv_0: Validation failed ) \\ Minimum size is 2 ( cv_1.code: Minimum size is 2 ) \\ Validation failed ( cv_1: Validation failed ) \\ Minimum size is 2 ( cv_2.code: Minimum size is 2 ) \\ Validation failed ( cv_2: Validation failed ) \\ Minimum size is 2 ( **cv_2.cv_3.code**: Minimum size is 2 ) \\ Validation failed ( **cv_3**: Validation failed ) \\ Minimum size is 2 ( **cv_2.cv_3.cv_4.code**: Minimum size is 2 ) \\ Validation failed ( **cv_4**: Validation failed ) play.data.validation ; ValidCheck.isSatisfied(...) { String superKey = ValidationPlugin.keys.get().get(validatedObject); * Discussion: [[http://groups.google.com/group/play-framework/browse_thread/thread/b99225f1aff2c23c]] * bug ticket: [[http://play.lighthouseapp.com/projects/57987-play-framework/tickets/726]] The solution in my case was to a negative fake id to empty entities before calling the Validation. ===== Detached object and GenericModel.merge() problem ===== 2011-04-12 [[http://groups.google.com/group/play-framework/browse_thread/thread/53c8cd8e45def724]] ===== Invalid SQL syntax for count() query with Entity which have Identity composite key ===== 2011-04-09 [[http://play.lighthouseapp.com/projects/57987-play-framework/tickets/717|ticket #717]] ===== "Sample validation" has error (play.test.ApplicationTest does not exists) ===== 2011-02-27 [[http://play.lighthouseapp.com/projects/57987-play-framework/tickets/615|ticket #615]]