i have some puzzle with "many-to-one", "one-to-many", "many-to-many"
now, i use the mapping files without such as "many-to-one",
so i can use HQL expression like SQL .
for example ,
if the mapping without "many-to-one"
i can write code as :
select a.m, a.x, b.y from A a, B b where a.m=b.m and a.n=b.n
a.m , a.n is a foreign key , b.m and b.n is a composite primary key
but
the mapping file for table A created by middlegen has element "many-to-one". and class A has no field name like "m" or "n"
so i can't write HQL like
"select a.m, a.x, b.y from A a, B b where a.m=b.m and a.n=b.n"
because Class A for table A has no property named "m"
i think that isn't intuitionistic. and perhaps it will effect replantting.
>>>i've write many codes with mapping without "many-to-one".
if i change to use "many-to-one" , i seems i must rewrite the codes.
i don't want to do that. is there anything i did wrong. or there has a better solution?
>>> i don't know how to ask this question better. i wish someone could understand what i means.
_________________ I am the creatxr of world.
|