1
2 session s = hibernateutil.
CurrentSession
(
);
3 Transaction t = s.
BeGintransaction
(
);
4
5 query q = s.
CREATEQUERY
("From Trade T, ACLROLE R WHERE T.
TRADE_ID =
1 and r.
ROLENAME =
'Lyorole' "
);
6 Q.
SetFirstResult
(
0
);
7 Q.
SetMaxResults
(
10
);
8
List list = q.
List
(
);
9
10
INT i =
0;
11
for
(i =
0; i Size ( ); i ) { ...} 12 Object [ ] o = ( Object [ ] List. get (i ); 13 for ( INT j = 0; j Length; J ) { ...} 14 Object = o [J ]; 15 IF (Oo InstanceOf TRADE) ) { ...} 16 trade tt = (Trade) ) oo; 17 OUT. PRINTLN (" Gettrade_id ( ) " td> tr>" ); 18 } Else IF (Oo InstanceOf Aclrole ) { 19 ACLROLE R = (ACLROLE ) oo; 20 OUT. PRINTLN (" GetroleID ( ) " td> tr>" ); twenty one } twenty two twenty three } twenty four } 25 OUT. PRINTLN ("I is:" i ); 26 27 t. Commit ( ); 28 hibernateutil. CloseSession ( ); GET Trade:" TT.
GET ROLE:" R.