Hibernate version:3.1
Mapping documents: I've got 3 tables:
Department [department_id,name] Category_Department [category_id, department_id] Category[category_id, category_group, name]
category_group can and is repeted in this table and is ment to create a grouping. For example:
DATA ROWS: 1, SUBJ, English 2, SUBJ, Science 3, SUBJ, Math
Name and version of the database you are using:Oracle9i
Is it possible to create an annotation that will allow for the following structure in the Department object ?
public Set getCategory( String catGroup ) {
return categories.get( catGroup );
}
public void setCateogries(Map<String, Set> categories) {
this.categories = categories;
}
Where the Map (HashMap) contains a String
@MapKey(name="category_group")
And the Set<Category> is a all the categories in that group for the department.
If this is not possible in annotations how can it be done in XML?
How can you use both annotations and XML configuration?
Thanks!
Josh
New York University
|