Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » @Entity gives mapped class not specified error with 2 persistence units
@Entity gives mapped class not specified error with 2 persistence units [message #434950] Mon, 08 September 2008 23:12 Go to next message
Bill Blalock is currently offline Bill BlalockFriend
Messages: 118
Registered: July 2009
Location: Alabama
Senior Member
Hi all.

I am new at this so please bear with me.

I have 2 persistence units in my project because the data is on two
servers with 2 SQL engines and the project combines the data.

Five tables are in the first unit. One table is in the second. I defined
the first five tables, added the 2nd persistence unit, and then tried to
develop the domain modle for the table in the 2nd persistence unit.

The @Entity annotation has the error "This mapped class is not specified
in persistence unit "sysmon"". "sysmon" is the name of the first
persistence unit. How do I get around this?

I am only using the persistence.xml file, no orm.xml file. Trying to use
annotations only.

This is the persistence.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" 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_1_0.xsd">

<persistence-unit name="sysmon" transaction-type="RESOURCE_LOCAL">
<class>
domain_model.Exftpclg00</class>
<class>
domain_model.Fslog00</class>
<class>
domain_model.Msgdef00</class>
<class>
domain_model.Xfrctl00</class>
<class>
domain_model.XfrctlSelection</class>
<properties>
<property name="eclipselink.jdbc.url"
value="jdbc:as400:host:prompt=false;date
format=iso;naming=sql;libraries=*LIBL SYSMONDB$ CPRSSECDTA TCPEXT"/>
<property name="eclipselink.jdbc.user" value="XXXXXXX"/>
<property name="eclipselink.jdbc.password" value="XXXXX"/>
<property name="eclipselink.jdbc.driver"
value="com.ibm.as400.access.AS400JDBCDriver"/>
<property name="eclipselink.session.customizer"
value="eclipselink.SessionSysmonCustomizer"/>
<property name="eclipselink.target-database"
value="eclipselink.DB2UDBiSeriesPlatform"/>
</properties>

</persistence-unit>
<persistence-unit name="dataexpress" transaction-type="RESOURCE_LOCAL">
<class>
domain_model.Ftplog01</class>
<properties>
<property name="eclipselink.jdbc.url"
value="jdbc:sqlserver:host:1433;databaseName=FTPLOG"/>
<property name="eclipselink.jdbc.user" value="XXXXXX"/>
<property name="eclipselink.jdbc.password" value="XXXXXX"/>
<property name="eclipselink.jdbc.driver" value="C:\javalib\Microsoft SQL
Server 2005 JDBC Driver\sqljdbc_1.2\enu\sqljdbc.jar"/>
</properties>
</persistence-unit>

</persistence>

The @Entity of domain_model.Ftplog01 annotation has an error because it is
not listed in "sysmon" persistence unit classes.

How do I get around this?

Thanks all
Bill Blalock
Re: @Entity gives mapped class not specified error with 2 persistence units [message #434989 is a reply to message #434950] Wed, 17 September 2008 14:43 Go to previous message
Neil Hauge is currently offline Neil HaugeFriend
Messages: 470
Registered: July 2009
Senior Member
Hi Bill,

You have run into a limitation in the Dali tooling, specifically that we
don't support multiple persistence units in the same project yet. See bug
194833 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=194833) for details.

The current workaround for this is to work with only one persistence unit
at a time when working with Dali. This is accomplished by commenting out
the Persistence Units other than the one you want to configure/validate
using the tools. By doing this you should get the correct DB metadata
associated with the appropriate Entities.

To get around the Mapped Class error message, you can change the project
properties to "Discover Annotated Classes Automatically". This will
disable the error message regarding the Entities not being specified in
the Persistence Unit. You can still use the persistence.xml->Synchronize
Classes option to keep the class listing in the PU up-to-date.

Give this a try and let me know how it goes.

Neil
Re: @Entity gives mapped class not specified error with 2 persistence units [message #611825 is a reply to message #434950] Wed, 17 September 2008 14:43 Go to previous message
Neil Hauge is currently offline Neil HaugeFriend
Messages: 470
Registered: July 2009
Senior Member
Hi Bill,

You have run into a limitation in the Dali tooling, specifically that we
don't support multiple persistence units in the same project yet. See bug
194833 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=194833) for details.

The current workaround for this is to work with only one persistence unit
at a time when working with Dali. This is accomplished by commenting out
the Persistence Units other than the one you want to configure/validate
using the tools. By doing this you should get the correct DB metadata
associated with the appropriate Entities.

To get around the Mapped Class error message, you can change the project
properties to "Discover Annotated Classes Automatically". This will
disable the error message regarding the Entities not being specified in
the Persistence Unit. You can still use the persistence.xml->Synchronize
Classes option to keep the class listing in the PU up-to-date.

Give this a try and let me know how it goes.

Neil
Previous Topic:SQL Server 200 tinyint mapping to Object
Next Topic:SQL Server 200 tinyint mapping to Object
Goto Forum:
  


Current Time: Thu Nov 27 10:45:39 GMT 2014

Powered by FUDForum. Page generated in 0.01939 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software