Hibernate version:
3.0
Mapping documents:
Excerpt (names rewritten to protect the innocent):
....
<property name="otherTableField"
column="NUMBER"
type="string"
formula="( SELECT other.otherField FROM schema.otherTable other WHERE substr(number, 1, (length(number)-5)) = other.connectingField )"/>
....
Name and version of the database you are using:
DB2 v8.1.0.16 FixPak 2
The generated SQL (show_sql=true):
Excerpted again (names changed again):
select * from ( select ...., ( SELECT other.otherField FROM schema.otherTable other WHERE substr(firsttable_.number, 1, (length(firsttable_.number)-5)) = other.connectingField ) as formula0_ from otherschema.firsttable firsttable_ where (...) ) as temp_ where rownumber_ <= ?
Ok, so my question is, I'd like to only retrieve these objects (we'll call them firsttableobjects) when a value exists in otherTableField. That is, I only want to retrieve them when otherTableField is not null. I saw the property non-null, but I wasn't sure if this is what it was meant for.
The big key here is that I cannot modify any of these tables in the DB. So I saw that not-null was talking about DDL and it got me scared. Does anyone know if using not-null will change the DB? And if not, will it do what I want?
Thanks!
Susan
|