Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Custom SQL Functions?
Custom SQL Functions? [message #388106] Thu, 21 May 2009 19:54 Go to next message
Eclipse UserFriend
I am looking into the viability of porting our applications to EclipseLink
from Hibernate. One thing I haven't been able to easily figure out is how
to register custom SQL functions. For example, we have some setup in
Hibernate for use with Oracle Text by extending the OracleDialect and
registering them like this:

registerFunction("score", new StandardSQLFunction("score",
Hibernate.INTEGER));
registerFunction("contains", new StandardSQLFunction("contains",
Hibernate.INTEGER));

I'm assuming to do the same in EclipseLink we would extend the
Oracle10Platform and somehow register them in there, but I can't see any
obvious ways of doing that. I also haven't been able to find any
documentation that describes how one would do this.

Are there any examples or documentation anywhere I can look at to learn
how to do this?

Thanks.

- Spencer
Re: Custom SQL Functions? [message #388118 is a reply to message #388106] Mon, 25 May 2009 13:38 Go to previous message
Eclipse UserFriend
How are these functions used, from queries?

In EclipseLink you can define your own expression operators using the
ExpressionOperator class and registering these with the platform or with
ExpressionOperator. You can then use them in EclipseLink Expression
queries using the Expression getFunction(int) API.

You cannot currently use them in JPQL however (please log a bug for that).

You can also any database function using getFunction(String) and just give
the database function name. You could also use native SQL for the query.

---
James
http://www.nabble.com/EclipseLink---Users-f26658.html
Previous Topic:Object database db4o EclipseLink integration
Next Topic:JPQL and Spatial Queries
Goto Forum:
  


Current Time: Wed Jul 23 08:05:23 EDT 2025

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

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

Back to the top