Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.2.0
-
Fix Version/s: 1.2.0
-
Component/s: trails-core, trails-hibernate, trails-security
-
Labels:None
-
Environment:XP Pro, apache-maven-2.0.8, eclipse-3.3.1.1, jre-1.5.0_14, ognl-2.7.3-SNAPSHOT, tapestry-4.1.6-SNAPSHOT , MySQL-5.0.45
-
Number of attachments :
Description
ROLES do not update on view after creation (after cancel do you see them)
While operating a Person.JAVA from roster demo which implements ACEGI UserDetails
Steps to reproduce
1. create new person
1.1 whiel in creation editor, assign roles from lhs to rhs
2. save
3. edit
Roles remaiin on lhs
hit cancel and re-edit
roles now show up as configured.
Resolved by editing equals/hashcode
@Override
{ return (getId() != null ? getId().hashCode() : 0); }public int hashCode()
/**
*/
@Override
public boolean equals(Object rhs) { if (this == rhs) return true; // instance equality if (rhs == null || getClass() != rhs.getClass()) return false; // null/class equality final Role castedObject = (Role) rhs; return !(getId() != null ? !getId().equals(castedObject.getId()) : castedObject.getId() != null); }
and operatiing proper cascade...
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
{ @JoinColumn(name = "person_table_primary_key") }@JoinTable(
name = "join_table_person_role",
joinColumns =
,
{ @JoinColumn(name = "role_table_primary_key")}inverseJoinColumns =
)
{ return roles; }public Set<Role> getRoles()