hi,
currently, i am building a m:n non-decomposing mappings. User, Role and
Users_Roles (intermediary table), the repository.xml is as such,
<class-descriptor
class="my.com.shinyang.eply.model.User"
table="USERS">
<field-descriptor
name="label"
column="LABEL"
jdbc-type="VARCHAR"
primarykey="true"
/>
<field-descriptor
name="password"
column="PASSWORD"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="fullName"
column="FULLNAME"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="designation"
column="DESIGNATION"
jdbc-type="VARCHAR"
/>
<collection-descriptor
name="roleList"
element-class-ref="my.com.shinyang.eply.model.Role"
auto-retrieve="true"
auto-update="false"
auto-delete="false"
indirection-table="USERS_ROLES">
<fk-pointing-to-this-class column="USERS_LABEL"/>
<fk-pointing-to-element-class column="ROLES_LABEL"/>
</collection-descriptor>
</class-descriptor>
<class-descriptor
class="my.com.shinyang.eply.model.Role"
table="ROLES">
<field-descriptor
name="label"
column="LABEL"
jdbc-type="VARCHAR"
primarykey="true"
/>
<field-descriptor
name="roleName"
column="ROLE_NAME"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="allowCreate"
column="ALLOWCREATE"
jdbc-type="INTEGER"
/>
<field-descriptor
name="allowSearch"
column="ALLOWSEARCH"
jdbc-type="INTEGER"
/>
<field-descriptor
name="allowEdit"
column="ALLOWEDIT"
jdbc-type="INTEGER"
/>
<field-descriptor
name="allowDelete"
column="ALLOWDELETE"
jdbc-type="INTEGER"
/>
<collection-descriptor
name="userList"
element-class-ref="my.com.shinyang.eply.model.User"
auto-retrieve="true"
auto-update="false"
auto-delete="false"
indirection-table="USERS_ROLES">
<fk-pointing-to-this-class column="ROLES_LABEL"/>
<fk-pointing-to-element-class column="USERS_LABEL"/>
</collection-descriptor>
</class-descriptor>
and i have done a junit to test the tables.
this is the log of the test.
2003-10-16 13:25:54,855 ERROR [STDERR] Query "SELECT
A0.LABEL,A0.PASSWORD,A0.FULLNAME,A0.DESIGNATION FROM USERS A0 WHERE A0.LABEL
= 'yenonn' " execution time: 0 result set fetch time: 0
2003-10-16 13:25:54,902 ERROR [STDERR] Query "SELECT
LABEL,PASSWORD,FULLNAME,DESIGNATION FROM USERS WHERE LABEL = 'yenonn' "
execution time: 0 result set fetch time: 0
2003-10-16 13:25:54,918 ERROR [STDERR] Query "SELECT
ROLE_NAME,ALLOWDELETE,LABEL,ALLOWCREATE,ALLOWSEARCH,ALLOWEDIT FROM ROLES
WHERE LABEL = 'role0' " execution time: 0 result set fetch time: 0
2003-10-16 13:25:54,918 ERROR [STDERR] Query "SELECT
ROLE_NAME,ALLOWDELETE,LABEL,ALLOWCREATE,ALLOWSEARCH,ALLOWEDIT FROM ROLES
WHERE LABEL = 'role1' " execution time: 0 result set fetch time: 0
2003-10-16 13:25:54,918 ERROR [STDERR] Query "SELECT
ROLE_NAME,ALLOWDELETE,LABEL,ALLOWCREATE,ALLOWSEARCH,ALLOWEDIT FROM ROLES
WHERE LABEL = 'role2' " execution time: 0 result set fetch time: 0
2003-10-16 13:25:54,933 ERROR [STDERR] Query "INSERT INTO USERS
(LABEL,PASSWORD,FULLNAME,DESIGNATION) VALUES ('yenonn','yenonn','Hiu Yen
Onn','programmer') " execution time: 0
2003-10-16 13:25:55,043 ERROR [STDERR] Query "SELECT ROLES_LABEL FROM
USERS_ROLES WHERE USERS_LABEL='yenonn'" execution time: 0 result set fetch
time: 0
2003-10-16 13:25:55,043 ERROR [STDERR] Query "INSERT INTO USERS_ROLES
(USERS_LABEL,ROLES_LABEL) VALUES ('yenonn','role0')" execution time: 0
2003-10-16 13:25:55,043 ERROR [STDERR] Query "INSERT INTO USERS_ROLES
(USERS_LABEL,ROLES_LABEL) VALUES ('yenonn','role1')" execution time: 0
2003-10-16 13:25:55,043 ERROR [STDERR] Query "INSERT INTO USERS_ROLES
(USERS_LABEL,ROLES_LABEL) VALUES ('yenonn','role2')" execution time: 0
2003-10-16 13:25:55,058 ERROR [STDERR] Query "INSERT INTO ROLES
(LABEL,ROLE_NAME,ALLOWCREATE,ALLOWSEARCH,ALLOWEDIT,ALLOWDELETE) VALUES
('role0','syl-admin',1,1,1,1) " execution time: 15
2003-10-16 13:25:55,058 ERROR [STDERR] Query "DELETE FROM USERS_ROLES WHERE
ROLES_LABEL='role0'" execution time: 0
2003-10-16 13:25:55,058 ERROR [STDERR] Query "INSERT INTO ROLES
(LABEL,ROLE_NAME,ALLOWCREATE,ALLOWSEARCH,ALLOWEDIT,ALLOWDELETE) VALUES
('role1','syl-admin',1,1,1,1) " execution time: 0
2003-10-16 13:25:55,058 ERROR [STDERR] Query "DELETE FROM USERS_ROLES WHERE
ROLES_LABEL='role1'" execution time: 0
2003-10-16 13:25:55,058 ERROR [STDERR] Query "INSERT INTO ROLES
(LABEL,ROLE_NAME,ALLOWCREATE,ALLOWSEARCH,ALLOWEDIT,ALLOWDELETE) VALUES
('role2','syl-admin',1,1,1,1) " execution time: 0
2003-10-16 13:25:55,074 ERROR [STDERR] Query "DELETE FROM USERS_ROLES WHERE
ROLES_LABEL='role2'" execution time: 16
2003-10-16 13:25:55,074 ERROR [STDERR] Query "commit" execution time: 0
2003-10-16 13:25:55,074 ERROR [STDERR] Query "SET autocommit=1" execution
time: 0
2003-10-16 13:25:55,074 ERROR [STDERR] Query "SHOW VARIABLES LIKE
'tx_isolation'" execution time: 0 result set fetch time: 0
my problem is that, why does the deletion of Users_Roles is executed after
an insertion of
Roles done? how to get rid of not having a deletion of Users_Roles? what is
the setting that i should do? pls help....
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]