gilbertoca wrote: > > Yes, but for some reason it leaves the database in a inconsistent state: > > >> Testcase: >> com.google.constructor.extras.security.shiro.cayenne.UserCayenneTest: >> Caused an ERROR >> Referential integrity constraint violation: "FK_SHIRO_USER_ROLE_ROLE_ID: >> PUBLIC.SHIRO_USER_ROLE FOREIGN KEY(ROLE_ID) REFERENCES >> PUBLIC.SHIRO_ROLE(ID)"; SQL statement: >> delete from SHIRO_ROLE where ID = ? [23003-131] >> org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: >> "FK_SHIRO_USER_ROLE_ROLE_ID: PUBLIC.SHIRO_USER_ROLE FOREIGN KEY(ROLE_ID) >> REFERENCES PUBLIC.SHIRO_ROLE(ID)"; SQL statement: >> delete from SHIRO_ROLE where ID = ? [23003-131] >> at >> org.h2.message.DbException.getJdbcSQLException(DbException.java:316) >> > I will try to find the problem! > > I've found the problem. I was using: userUpdated.getRoles().remove(roleADMIN);
instead of userUpdated.removeFromRoles(roleADMIN); So, can't I use those LIST methods with Cayenne? Just the Cayenne one! Thanks a lot, Robert. Regards, Gilberto -- View this message in context: http://cayenne.195.n3.nabble.com/many-to-many-relation-tp3491p1609999.html Sent from the Cayenne - User mailing list archive at Nabble.com.
