This content has been marked as final.
Show 2 replies
-
1. Re: Is it possible to combine an Account with the Entity that it maps to?
pcraveiro Aug 14, 2014 8:23 PM (in response to noamichael)1 of 1 people found this helpfulHey Michael,
We do support the following mapping. Suppose you have a custom Account type as follows:
public class MyUser extends AbstractIdentityType implements Account { @AttributeProperty private Person person; // getter and setter }
Here, Person is a reference to a specific entity. Not necessarily managed by PicketLink, but any entity you want to have a reference to.
Now, take a look at the entity used to map the MyUser account type:
@Entity @IdentityManaged(MyUser.class) public class MyUserTypeEntity extends IdentityTypeEntity { @OneToOne (cascade = CascadeType.ALL) @AttributeValue private Person person; // getter and setter }
With that, every time you load a MyUser from your identity store, a Person instance will be available. The same thing when storing MyUser and setting a Person. It will be automatically persisted.
You can check a working example from the PicketLink AngularJS Quickstart.
Regards.
-
2. Re: Is it possible to combine an Account with the Entity that it maps to?
noamichael Aug 25, 2014 1:52 PM (in response to pcraveiro)Thank you for the example; it was a mapping I would have never thought of myself! I'll will implement it today and see how it works.
-Michael