DB query/filter with size of a relation
Hi folks,
I want to find only datasets that have at least one related dataset like so?
<QUERY entityType="MyType">
<GT attribute="relationList.length()" datatype="java.lang.Integer" value="0"/>
</QUERY>
relationList is the field created for a m:n relation on the side of MyType.
Can I use length or size or whatever to find out if at least one Entity is assigned (in the form it's a FS_INDEX)?
Thanks and cheers Heiko
0
-
Hello Heiko,
I would just check, if a column which must have values is not null. Something like this:
<QUERY entityType="MyType">
<NOTNULL attribute="relationList.fs_id"/>
</QUERY>But I used it only the other way around (to find datasets, which have no related dataset defined - in this case I check for IS_NULL). And i didn't used it within an FS_INDEX.
Best regards
Holger1 -
Thanks a lot Holger, exactly what I looked for and it works. You saved my day :)
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
2 commentaires