I have a big intuition that most of you guys should have some point in the past
debated and answered this question already, but after days and days looking and
seeking for some answer on the internet, I'm still without a solution.
The question is:
How torque handles and deals with many-to-many relations?
I'm aware of lots of comments about many-to-many in torque, things from:
"You must have one primary-key and the others should be unique instead of primary"
to thins like:
"It's perfectly possible have many-to-many relations like:
I understand the point of "Primary keys" in "Design considerations" of the
project web-site. (For every table, you should create a primary key which has no
meaning in real life.)
But there's a lot of cases that you really NEED or WANT to user multiple PK's.
Like in this case that I'm stucked, I really need a many-to-many relationship,
there's no way of workarounds or changeing tables structures.
What should I do? Accept the ridiculous argueing that Hibernate is better
because it have many-to-many relationship support?
In that mapping above, I can make it work, but only for retrieving objects.
It works perfectly hidrating the objects, no problem at all.
But I can not create a new object, by the time of .save() method, It raises an
exception of "Criteria has nothing to insert", it's something saying that the
criteria was empty, and so on nothing is inserted/saved into database.
What you guys could say me about multiple PK's in torque, what's wrong on this
mapping and what would be the dificulties of implementing in Torque many-to-many
relations since it already works for retrieving objects with multiple PK's?
ps: Just for records, the mapping above genarates wrong SQL CREATE TABLE Syntax,
since the default on genarator for primaryKey is add and "AUTO_INCREMENT" statement,
if you set those columns autoIncrement="false" than it generates right DDL for that
Thanx in advance
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com