openejb-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thiago Veronezi <thi...@veronezi.org>
Subject Re: OpenEJB and Database Views
Date Fri, 11 Feb 2011 14:11:36 GMT
Hi,
You can try it by changing the JPA implementation from openjpa to
hibernate.
I think jboss uses hibernate as default, so I believe you can get the
same behavior by using it too.

*****************************************************
<!-- pom.xml -->
<dependency> <groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.0.Final</version> </dependency> <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId> <version>4.1.0.Final</version>
</dependency>

<repository>
<id>jboss-public</id>
<name>jboss-public</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss</url>
</repository>
*************************************************
<!-- persistence.xml -->
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">

<persistence-unit name="embeddedPU">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>myDatabase</jta-data-source>
<non-jta-data-source>myDatabaseUnmanaged</non-jta-data-source>

<properties>
<!-- OPENJPA -->
<!-- property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true)"/ -->
<!-- property name="openjpa.Log" value="SQL=TRACE"/ -->

<!-- HIBERNATE -->
<property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="false"/>
</properties>
</persistence-unit>
</persistence>



[]s,
Thiago.

On Fri, Feb 11, 2011 at 8:57 AM, kenundrumz2100 <kenundrumz2100@gmail.com>wrote:

>
> Hey Mark,
>
> Thanks for the reply.
>
> We do not use maven for our builds.
>
> Also, we actually currently are doing the creation of the tables manually
> with the old fashioned SQL files like you talked about, but because we are
> still in a development stage we really don't want to add one more level of
> complexity to the steps. In this case, we don't want to have to alter the
> SQL scripts every time we want to add or remove or change a name of a
> variable, especially when the deployment container (in our case JBoss) will
> do that for us for free. It's just the OpenEJB mocked out container that
> has
> a problem dealing with the views. We really were hoping that the
> SyncronizeMappings class would have a parameter that would deal with this
> easily, or at least easier than we are having right now. I imagine we are
> not the first people to want to map views to entity beans, and i would like
> to hope someone out there has done something to unit test them together in
> a
> fashion.
>
> While we are open to the idea of SQL files if that is the only option, it
> just defiantly is not the best option, especially with how many tables we
> will be having at the end of the development cycle.
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/OpenEJB-and-Database-Views-tp3299801p3301314.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

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