openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MiƂosz Tylenda <mtyle...@o2.pl>
Subject Re: database dependent queries
Date Wed, 10 Jun 2009 12:05:11 GMT
Hi Michael,

Have you tried the @PersistenceUnit inside a bean:

@PersistenceUnit EntityManagerFactory emf

This should inject the EMF into the bean.

Cheers,
Milosz


> Hello,
> 
> We need to use database dependent native queries ("fast lane reader pattern"). Therefore
we need
> to load the appropriate statements stored e.g. in a properties file, the name of which
is
> derived from the database (e.g. "sqlserver.sql")
> I wanted to determine the name by evaluating
> entityManagerFactory.getProperties ().get("Platform");
> 
> Running this standalone works but within a bean I don't have access to the EMF, do I?
> Is there another to determine which database is in use?
> 
> kind regards, Michael
> 

Mime
View raw message