We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 10
java version "1.8.0_333"
Please describe the expected behavior of the issue, starting from the first action.
This is the code of the method which throws the error.
private void cascadeOrphans(JPABase base, PersistentCollection persistentCollection, boolean willBeSaved) { String dbName = JPA.getDBName(this.getClass()); SessionImpl session = ((SessionImpl) JPA.em(dbName).getDelegate()); PersistenceContext pc = session.getPersistenceContext(); CollectionEntry ce = pc.getCollectionEntry(persistentCollection); if (ce != null) { CollectionPersister cp = ce.getLoadedPersister(); if (cp != null) { Type ct = cp.getElementType(); if (ct instanceof EntityType) { EntityEntry entry = pc.getEntry(base); String entityName = entry.getEntityName(); // <- Exception thrown here entityName = ((EntityType) ct).getAssociatedEntityName(session.getFactory()); if (ce.getSnapshot() != null) { Collection orphans = ce.getOrphans(entityName, persistentCollection); for (Object o : orphans) { saveAndCascadeIfJPABase(o, willBeSaved); } } } } } }
The reason for these 3 lines escapes me:
EntityEntry entry = pc.getEntry(base); String entityName = entry.getEntityName(); // <- Exception thrown here entityName = ((EntityType) ct).getAssociatedEntityName(session.getFactory());
entityName is initialized with a value that is immediatly overwritten in the next line. Could this not be rewritten as:
entityName
String entityName = ((EntityType) ct).getAssociatedEntityName(session.getFactory());
Has someone else encountered this before?
The text was updated successfully, but these errors were encountered:
@ketain I haven't encountered this problem, but I clearly see this line should be removed. Feel free to submit a pull request!
Sorry, something went wrong.
xael-fry
Successfully merging a pull request may close this issue.
Play Version 1.6.x
Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)
Windows 10
JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)
java version "1.8.0_333"
Expected Behavior
Please describe the expected behavior of the issue, starting from the first action.
Actual Behavior
5 entity is not deleted; all changes are rolled back as they should
Findings
This is the code of the method which throws the error.
The reason for these 3 lines escapes me:
entityName
is initialized with a value that is immediatly overwritten in the next line. Could this not be rewritten as:Has someone else encountered this before?
The text was updated successfully, but these errors were encountered: