Hi,
Struggling with a problem the hole day and wonder if anyone may have an easy solution..
I have a Customer and Car class with a many-to-many relationship.
pubilc class Customer {
@id
private id;
@ManyToMany
@IndexColumn(name="idx")
private List<Car> cars = new ArrayList<Car>();
@Column
private float discount;
-- getters/setters --
}
pubilc class Car {
@id
-- other variables + getters/setters.
}
This generates a relationtable customer_car with customer, car and idx as variables.
However I would like to have the 'discount' variable from the Customer class to appear in the relation table customer_car as well so I have customer, car, idx and discount in the realation table.
/M
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html