Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Using views in CriteriaQuery(CriteriaQuery)
Using views in CriteriaQuery [message #719286] Fri, 26 August 2011 15:33 Go to next message
Chris Oman is currently offline Chris OmanFriend
Messages: 2
Registered: August 2011
Junior Member
The situation: web form that allows the user to fill out information to be used in a query.

Technologies: EclipseLink, H2, Glassfish

Problem: I have gotten nearly everything to work exactly as I want with the CriteriaQuery. The one problem I have remaining is that I want the user to also be allowed to type in a keyword and use the H2 'FT_SEARCH_DATA()' fulltext search function. I couldn't figure out how to use functions in the where portion of the CriteriaQuery, so I have created a view to do essentially the same thing as that function.

I am still having trouble figuring out how to include that view as a joined table in the CriteriaQuery. Has anyone done anything like this before? Can it be done?

Thanks,
Chris

[Updated on: Fri, 26 August 2011 15:34]

Report message to a moderator

Re: Using views in CriteriaQuery [message #720535 is a reply to message #719286] Tue, 30 August 2011 19:17 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

You can use the CriteriaBuilder.function() API to call a database function.

Critieria only allows querying objects, so there is no way to query a view (or table) unless it is mapped to an object.


James : Wiki : Book : Blog : Twitter
(no subject) [message #720544 is a reply to message #719286] Tue, 30 August 2011 19:17 Go to previous message
James is currently offline JamesFriend
Messages: 272
Registered: July 2009
Senior Member
You can use the CriteriaBuilder.function() API to call a database function.

Critieria only allows querying objects, so there is no way to query a view (or table) unless it is mapped to an object.

--
James : http://wiki.eclipse.org/EclipseLink : http://en.wikibooks.org/wiki/Java_Persistence : http://java-persistence-performance.blogspot.com/
Previous Topic:(no subject)
Next Topic:Different objects in different queries
Goto Forum:
  


Current Time: Tue Apr 23 13:35:55 GMT 2024

Powered by FUDForum. Page generated in 0.12532 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top