Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] EclipseLink/Example/JPA

I have resolved it by changing the relationship from @ManyToOne to @OneToOne and it seems right because the relation between EMPLOYEE and EMP_JOB is of OneToOne type.

--------------------------------------------------
From: "Jose Alvarez de Lara" <dakhla.0563@xxxxxxxxxxx>
Sent: Wednesday, March 10, 2010 7:15 PM
To: "EclipseLink User Discussions" <eclipselink-users@xxxxxxxxxxx>
Subject: Re: [eclipselink-users] EclipseLink/Example/JPA

Hi Tom,

Using Eclipse Galileo RS1 and against OracleXE an Glassfish v3 I am trying EclipseLink/Examples/JPA/2.0/Employee I have created an schema EMPLOYEE and from entities I have created the tables. Everything is ok.

But I think there was a wrong definition of the entities because they have created a relation table EMP_JOB basing on,

@ManyToOne(fetch = FetchType.LAZY)
@JoinTable(name = "EMP_JOB", joinColumns = @JoinColumn(name = "EMP_ID"), inverseJoinColumns = @JoinColumn(name = "TITLE_ID"))
   private JobTitle jobTitle;

where TITLE_ID does not exist and, in my opinion, it has to be JOB_ID. Maybe I am wrong, of course.

This is what I have done. I have changed the column name fom TITLE_ID to JOB_ID, and connected to the EMPLOYEE schema.

And everything went ok except for the entity Employee. Eclipse gives me an error in the following code,

@ManyToOne(fetch = FetchType.LAZY)
@JoinTable(name = "EMP_JOB", joinColumns = @JoinColumn(name = "EMP_ID"), inverseJoinColumns = @JoinColumn(name = "JOB_ID"))
   private JobTitle jobTitle;

The error is "Join column jobTitle_JOB_ID cannot be resolved" and I do not know how to resolve from Eclipse.

Regards,
Jose

--------------------------------------------------
From: "Tom Ware" <tom.ware@xxxxxxxxxx>
Sent: Monday, March 08, 2010 3:15 PM
To: "EclipseLink User Discussions" <eclipselink-users@xxxxxxxxxxx>
Subject: Re: [eclipselink-users] EclipseLink/Example/JPA

In general our examples include database configuration code - it is just a matter of pointing at the database you have chosen. If you need some help with that, just let this mailing list what specific problem you are running into.

Here's an example of how setup will work for one of our examples RCP example. Other examples should be simliiar, and, if anything, less complicated to setup.

http://fisheye2.atlassian.com/browse/eclipselink/trunk/examples/org.eclipse.persistence.example.jpa.rcp.comics/ReadMe.txt?r=2098

If you don't have a database, some good starting points are:

http://www.mysql.com/
http://db.apache.org/derby/
http://www.postgresql.org/

-Tom

Tim Hollosy wrote:
I think he's asking where he can get a copy of the Derby database used
in the comics examples...

./tch



On Mon, Mar 8, 2010 at 8:55 AM, Tom Ware <tom.ware@xxxxxxxxxx> wrote:
Hi Jose,

It is not clear to me what exactly your problem is. EclipseLink should work with most database available today. If you're looking for a free one,
try MySQL, PostGres or Derby.

-Tom

Jose Alvarez de Lara wrote:
Hi,
 I would like to try the examples at
http://wiki.eclipse.org/Category:EclipseLink/Example/JPA
but I do not know where can I get the database for every example.
 Regards,
Jose

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

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Back to the top