openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Implement an attribute with a custom native query?
Date Sat, 30 Jan 2010 00:30:54 GMT
I seem to remember Hibernate (non-JPA, at least) had the capability to
implement a mapped property that is implemented by an
application-specified query (native SQL, perhaps).  I have a one-to-many
attribute that really can't be implemented without an Oracle-specific
query (have to do a regexp check for a token in a csl).  I could just
implement a DAO method that uses the native query I need and just call
it manually to get the list (and not map the one-to-many to JPA), but it
would be cleaner if I could somehow specify the query in the mapping
file, or some other way where it's produced at the "mapping" layer, even
if it's not specified entirely in the mapping config.

Are there any useful strategies that I could take advantage of here?

View raw message