• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Toplink Collection Problem

 
Abhishek Mish
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
I am facing the problem while trying to get the size of collection using toplink expression.
Example.(in java)
request.getElement().size() == 0
I need to build the expression for the equivalent of the above code.
I tried to build the expression as below
new ExpressionBuilder().size("Element")but i am getting the compilation error.
I think the version of toplink i am using does not contain size API, pls suggest any other options.

Rgds,
Abhishek
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
size(String) is a method on the TopLink Expression class, so it should compile, could you include the compile error you are getting and your code.

In general size in SQL is actually a complex expression requiring a sub-select. TopLink does this for you when using the size(String) method, but you can also define the sub-select query yourself.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic