Second trial (first was two weeks ago)
Hi all,
please can you help me with this case ?
I want OJB to generate a sqlstatement like this:
SELECT *
FROM AdminLog A0 INNER JOIN CPMUser A1 ON A0.FK_UserID=A1.PK_UserID
WHERE (((A1.FK_InstituteID = 'xxx')
AND A1.Branch LIKE 'ABC\_XYZ' ESCAPE '\')
AND A0.LoginTimestamp >= '2005-06-30 12:30:04')
AND A0.LoginTimestamp <= '2005-06-30 13:04:02'
ORDER BY 1
AdminLog has a reference-descriptor to CPMUser via UserID and CPMUser has a
reference-descriptor to Institute via InstituteID. Branch is a column of
CPMUser
The Problem ist the escapesign and the word ESCAPE
I tried it without ESCAPE:
Criteria c = new Criteria();
c.addEqualTo("ref_AdminLog.ref_Institute." +
Institute.getpk_instituteidSQLName(), instituteId);
c.addLike("ref_User." + CPMUser.getbranchSQLName(), branch);
c.addGreaterOrEqualThan(AdminLog.getlogintimestampSQLName(),fromDate);
c.addLessOrEqualThan(AdminLog.getlogintimestampSQLName(), toDate);
return AbstractPersistency.selectOrderedByCriteria(AdminLog.class,
c,
new String[]{AdminLog.getlogintimestampSQLName()},
new boolean[]{true});
Works fine, if there is no branch "ABC1XYZ" or so, but how do I get ESCAPE
into this statement ??
Please help.
Thanks in advance
Christine
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]