Outils pour utilisateurs

Outils du site


informatique:java:frameworks:play_framework:play_1.2_bugs

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:

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]

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 ?

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 ticket #729

Validation entités sans id

2011-04-13 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);

The solution in my case was to a negative fake id to empty entities before calling the Validation.

Detached object and GenericModel.merge() problem

Invalid SQL syntax for count() query with Entity which have Identity composite key

2011-04-09 ticket #717

"Sample validation" has error (play.test.ApplicationTest does not exists)

2011-02-27 ticket #615

informatique/java/frameworks/play_framework/play_1.2_bugs.txt · Dernière modification : 28/12/2015 01:16 de cyrille

Sauf mention contraire, le contenu de ce wiki est placé sous les termes de la licence suivante : CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki