Howto configure the JPA facet?

This is my persistence.xml:

org.hibernate.ejb.HibernatePersistence ]]>

I don't know if this is an efficient way to define a persistence unit (I copied this definition from Seam). I used another persistence unit definition (maybe copied from Spring) and it worked fine too.

Attached is the JPA configuration screen. I don't know how to specify the data source for the demoDatabase persistence unit. I think that's the reason there's an error "Cannot resolve table 'geoarea'" for this class:

@Entity
@Table(name = "geoarea")
public class GeoArea {
@Id
private Long zipCode;
@Column(nullable = false, length = 32)
private String city;

How can I solve this problem? (without removing the JPA facet :) )



Attachment(s):
JPA-Facet.png
0

DataSources can be configured in Tools/Data Sources.
DS-Unit mapping is defined in facet configuration or using QuickFix
available at the highlighted table/column.

Gregory Shrago


Thai Dang Vu wrote:

This is my persistence.xml:

<persistence-unit name="demoDatabase" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver"/>
<property name="hibernate.connection.username" value="hannah"/>
<property name="hibernate.connection.password" value="hannah"/>
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true" />
</properties>
</persistence-unit>

I don't know if this is an efficient way to define a persistence unit (I copied this definition from Seam). I used another persistence unit definition (maybe copied from Spring) and it worked fine too.

Attached is the JPA configuration screen. I don't know how to specify the data source for the demoDatabase persistence unit. I think that's the reason there's an error "Cannot resolve table 'geoarea'" for this class:

@Entity
@Table(name = "geoarea")
public class GeoArea {
@Id
private Long zipCode;
@Column(nullable = false, length = 32)
private String city;

How can I solve this problem? (without removing the JPA facet :) )


------------------------------------------------------------------------

0

请先登录再写评论。