i have a table
**Permission**:
- permission_id
- permission_name
- permission_desc
and a table **PermissionCategory** with one to many relation to **Permission**
is it possible to return map <key,value> in one to many relationship instead of list.
this is what i am doing right now in **PermissionCategory** domain:
Code:
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = "perm_cat_map", joinColumns = { @JoinColumn(name = "perm_cat_id") }, inverseJoinColumns = { @JoinColumn(name = "permission_id") })
private List<Permission> permissions = new ArrayList<Permission>(0);
is it possible to have something like:
Code:
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = "perm_cat_map", joinColumns = { @JoinColumn(name = "perm_cat_id") }, inverseJoinColumns = { @JoinColumn(name = "permission_id") })
private Map<String,String> permissions = new ArrayList<String,String>(0);
where the two strings are **permission_id**, **permission_name**.
please advise, thanks.