openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Logemann ...@logemann.org>
Subject Re: docs concerning FilterListener and other extension points
Date Thu, 26 Feb 2009 00:39:31 GMT
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

Mime
View raw message