please help, errors with Map <Entity, Basic> [message #882327] |
Wed, 06 June 2012 09:04 |
Luisa Rossi Messages: 5 Registered: June 2012 |
Junior Member |
|
|
Please help,
In my bean I have attribute as:
private Map <Skill, Date> skills;
I am using orm.xml instead of annotations and have this chunk of configuration:
<element-collection name="skills">
<map-key-join-column name="ID_SKILL" />
<column name="ACQUIRED_ON" />
<temporal>DATE</temporal>
<collection-table name="ACQUIRED_SKILL">
<join-column name="ID_EMPLOYEE" />
</collection-table>
</element-collection>
in my db tables are like this:
create table EMPLOYEE (
ID_EMPLOYEE numeric (12) not null,
DESCRIPTION varchar(500) null
);
alter table EMPLOYEE add primary key (ID_EMPLOYEE);
create table SKILL (
ID_SKILL numeric (12) not null,
DESCRIPTION varchar(500) null
);
alter table SKILL add primary key (ID_SKILL);
create table ACQUIRED_SKILL (
ID_SKILL numeric (12) not null,
ID_EMPLOYEE numeric (12) not null,
ACQUIRED_ON date null
);
alter table ACQUIRED_SKILL add primary key (ID_SKILL,ID_EMPLOYEE);
alter table ACQUIRED_SKILL add foreign key (ID_SKILL) references SKILL (ID_SKILL);
alter table ACQUIRED_SKILL add foreign key (ID_EMPLOYEE) references EMPLOYEE (ID_EMPLOYEE);
when I put a 'transient' on the attribute of my bean everything apart of this mapping works, probably because it's ignored, otherwise i get exceptions:
[EL Config]: metadata: 2012-06-06 10:39:24.821--ServerSession(8906500)--Thread(Thread[main,5,main])--The primary key column name for the mapping element [field skills] is being defaulted to: ID_EMPLOYEE.
[EL Config]: metadata: 2012-06-06 10:39:24.821--ServerSession(8906500)--Thread(Thread[main,5,main])--The primary key column name for the mapping element [field skills] is being defaulted to: ID_SKILL.
Exception [EclipseLink-30005] (Eclipse Persistence Services - 2.4.0.v20120604-r11619): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: sun.misc.Launcher$AppClassLoader@35ce36
Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.4.0.v20120604-r11619): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [sara-beans] failed.
Internal Exception: java.lang.NullPointerException
P.S. eclipse 3.7sr2, java 1.6.0.31
Thanks
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04600 seconds