You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Marc Logemann <li...@logemann.org> on 2009/02/25 23:43:55 UTC
docs concerning FilterListener and other extension points
Hi,
i am on the way migrating a 120+ domain classes app from Kodo (jdo) to
OpenJPA. But since we were power users of kodo with a whole lot of
custom functions and extensions we need to rebuild them in OpenJPA.
Unfortunately i found no docs at all regarding this. The official
openJPA docs contains nothing and even the examples are non-existant
for these topics. Back in Kodo times, there were some examples for
custom mappings and functions.
Can someone point me to something? I mean, someone should know about
this right? :-) Even if i would start with looking into
org.apache.openjpa.kernel.exps.StringContains which could work as a
blueprint, i still dont know how to register stuff.
Thanks for info on the state of affairs.
Marc
Re: docs concerning FilterListener and other extension points
Posted by Marc Logemann <li...@logemann.org>.
Hi,
some more detailed questions on custom functions. I found that:
http://openjpa.apache.org/builds/latest/docs/javadoc/org/apache/openjpa/jdbc/kernel/exps/JDBCWildcardMatch.html
The example in this javadoc is this line of JPAQL:
"address.street.ext:wildcardMatch (\"?ain*reet\")"
I dont bother about wildcardMatch itself but i am wondering if this
".ext:" notation is somewhere defined. I crawled the JPA specs and
found no reference to it. So is there a custom OpenJPA-JPAQL parser or
something? In fact i can see no reference to custom functions in JPA
at all. This makes me mad. Really wild guessing here.
At this point i have my custom function (aka FilterListener) installed
via persistence.xml like this:
<property name=" openjpa.jdbc.JDBCListeners "
value="de.logentis.openjpa.LevenshteinDistanceMatch"/>
Can i go on with something like this in my JPAQL ? :
Query query = em.createQuery("select p from Person p where
p.name.ext:levenshteinMatch(?1, 8))");
Of course my Filter accepts two arguments and returns the name of the
written function via getTag().
Thanks for infos and when i through all this, i would love to
contribute some examples in the examples folder of the distro!
Marc