Externalizing persistence.xml orm properties within an OSGi container using Felix, JPA, Aries and Hibernate -
i’m working on large refactoring of project goal of using jpa aries within osgi container persistence (rather plain old j2ee stack).
currently far good, i’m following guidance of tasklit blueprint (it managed jpa) example website , works fine (i’m using felix 5, aries jpa 2.1 version , hibernate 4.3+ orm)
i’m trying make solution configurable possible, persistence.xml this:
<persistence-unit name="audit" transaction-type="jta"> <jta-data-source>osgi:service/javax.sql.datasource/(osgi.jndi.service.name=jdbc/audit)</jta-data-source> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.derbydialect"/> <property name="hibernate.hbm2ddl.auto" value="create-drop"/> </properties> </persistence-unit>
i have externalized datasource configuration using blueprint-cm configadmin datasource working good.
but i’m left these properties in red (like hibernate.dialect), think elegant way of externalizing them ?
note entitymanager injected this:
/** * entitymanager, injected blueprint jpa. */ @persistencecontext(unitname = "audit") private entitymanager entitymanager;
thanks help!
Comments
Post a Comment