Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313534 - JPA: entities in separate eclipse project must be explicitly listed in persistence.xml
Summary: JPA: entities in separate eclipse project must be explicitly listed in persis...
Status: RESOLVED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-19 10:37 EDT by Michael OBrien CLA
Modified: 2022-06-09 10:02 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael OBrien CLA 2010-05-19 10:37:47 EDT
>Issue: The present entity search algorithm does not find entities in separate eclipse projects
<exclude-unlisted-classes> has no effect in this configuration

Configuration: (I am using an eclipse .classpath reference only) - and not generating a jar file
- no MANIFEST.MF Class-Path entry
- no <jarfile> element in persistence.xml
- persistence.xml is in client project
- no persistence.xml in entities project
.classpath = 
	<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.example.jpa.server.entities"/>
	<classpathentry kind="src" path="src"/>

This may be expected behavior for SE PU's when we fail to use the persistence.xml element - as mormally the entities must be at the root of the classpath that contains persistence.xml
   <jarfile>entities.jar</jarfile>


>Not found:
using
       <exclude-unlisted-classes>false</exclude-unlisted-classes> // unrelated
       <!--class>org.eclipse.persistence.example.jpa.server.business.Cell</class-->

java.lang.IllegalArgumentException: Object: org.eclipse.persistence.example.jpa.server.business.Cell@19267322( id: null state: null left: null right: null parent: HashSet@3932167 references: HashSet@3932167) is not a known entity type.
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:4199)


>Found:
using
       <exclude-unlisted-classes>false</exclude-unlisted-classes>
       <class>org.eclipse.persistence.example.jpa.server.business.Cell</class>

[EL Config]: 2010-05-19 10:24:01.195--ServerSession(27196165)--Thread(Thread[main,5,main])--The access type for the persistent class [class org.eclipse.persistence.example.jpa.server.business.Cell] is set to [FIELD].
Comment 1 Michael OBrien CLA 2010-05-19 10:58:19 EDT
>This is normal behavior (after discussion with Tom)
Instead of using <exclude-unlisted-classes> in SE - it is usually used in EE to turn off the normal discovery
Searching the project directory above the entity root in eclipse is outside the spec.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:02:31 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink