openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Stultz <da...@6degrees.com>
Subject Code organization
Date Fri, 05 Jun 2009 13:47:24 GMT
Hello,

I'm frustrated by the fact that I need to define @NamedQuery and others
inside my entity classes. I would like to put what I consider "logic" where
I think it's appropriate which is often not with the model. Is there a way
to programmatically define Named Queries Sql Result Set Mappings, etc and
register them with the persistence engine? I.e. is there any alternative to
using annotations/xml for defining these things?

String query = "select o...";
NamedQuery nq = new NamedQuery(query);
Persistence.registerNamedQuery(nq);

Thanks.

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:daryl@6degrees.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message