Hibernate version: 2.1.1
Mapping documents: Xdoclet
Name and version of the database you are using: MySQL 4.1
The generated SQL (show_sql=true):
create table condition_type_value ( id BIGINT NOT NULL AUTO_INCREMENT, has_text BIT, is_defaulted_value BIT, value VARCHAR(255), fk_condition_type_value_id BIGINT, primary key (id) );
create table table_join_rights_condition_type_value ( fk_condition_type_value_id BIGINT not null, fk_condition_type_value BIGINT not null, fk_rights_id BIGINT not null, fk_rights BIGINT not null );
create table rights ( id BIGINT NOT NULL AUTO_INCREMENT, comments VARCHAR(255), rights_id BIGINT, fk_rights_type_id BIGINT, fk_condition_type_id BIGINT, primary key (id) );
I was hoping that someone might be able to point me in a certain direction with regard to what I am trying to do. As you can see for the generated SQL I have a many to many relationship between rights and conditionTypeValues, what I would also like to be able to do is add another attribute to table_join_rights_condition_type_value to capture comments. How is this done? I am using Xdoclet to generate the hibernate mappings, any input would be more appreicated.
CONDITION TYPE VALUE CLASS
--------------------
/**
* @return Returns the rights.
* @hibernate.bag
* table="table_join_rights_condition_type_value"
* cascade="all"
* inverse="true"
* @hibernate.collection-key
* column="fk_condition_type_value_id"
* @hibernate.collection-many-to-many
* class="au.edu.tlf.lips.model.Rights"
* column="fk_condition_type_value"
*/
public List getRights() {
return rights;
}
/**
* @param rights The rights to set.
*/
public void setRights(List rights) {
this.rights = rights;
}
RIGHTS CLASS
-----------------------------------------
/**
* @return Returns the conditionTypeValue.
* @hibernate.bag
* table="table_join_rights_condition_type_value"
* cascade="all"
* inverse="true"
* @hibernate.collection-key
* column="fk_rights_id"
* @hibernate.collection-many-to-many
* class="au.edu.tlf.lips.model.ConditionTypeValue"
* column="fk_rights"
*/
public List getConditionTypeValue() {
return conditionTypeValue;
}
/**
* @param conditionTypeValue The conditionTypeValue to set.
*/
public void setConditionTypeValue(List conditionTypeValue) {
this.conditionTypeValue = conditionTypeValue;
}
|