Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
ForeignCollection - javax.persistence
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mariák Kálmán  
View profile  
 More options Apr 23 2012, 10:57 am
From: Mariák Kálmán <r...@markcon.hu>
Date: Mon, 23 Apr 2012 07:57:21 -0700 (PDT)
Local: Mon, Apr 23 2012 10:57 am
Subject: ForeignCollection - javax.persistence
Hi!

Does it have:

@ForeignCollectionField(eager = false)
ForeignCollection<Order> orders;

an alternative javax.persistence?

Thanks for the answer!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gray Watson  
View profile  
 More options Apr 23 2012, 11:56 am
From: Gray Watson <256....@gmail.com>
Date: Mon, 23 Apr 2012 11:56:00 -0400
Subject: Re: ForeignCollection - javax.persistence
On Apr 23, 2012, at 10:57 AM, Mariák Kálmán wrote:

> @ForeignCollectionField(eager = false)
> ForeignCollection<Order> orders;

No there isn't and there should be.  Is that a ManyToOne?
gray

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mariák Kálmán  
View profile  
 More options Apr 24 2012, 3:35 am
From: Mariák Kálmán <r...@markcon.hu>
Date: Tue, 24 Apr 2012 00:35:07 -0700 (PDT)
Local: Tues, Apr 24 2012 3:35 am
Subject: Re: ForeignCollection - javax.persistence
On Apr 23, 5:56 pm, Gray Watson <256....@gmail.com> wrote:

> On Apr 23, 2012, at 10:57 AM, Mariák Kálmán wrote:

> > @ForeignCollectionField(eager = false)
> > ForeignCollection<Order> orders;

> No there isn't and there should be.  Is that a ManyToOne?
> gray

I tried this:
@Entity(name = "Instructors")
public class Instructor implements Serializable {

        private static final long serialVersionUID = 1L;

        public static final String ID_FIELD_NAME = "ID";

        @Id
        @Column(name = ID_FIELD_NAME)
        private Long id;

        @OneToMany(mappedBy = "instructor")
        private List<Position> positions;
...

}

@Entity(name = "Positions")
public class Position {

         public static final String ID_FIELD_NAME = "ID";

        @Id
        @Column(name = ID_FIELD_NAME)
        Long id;

        @ManyToOne
        @JoinColumn(name = "ID_INSTRUCTOR")
        Instructor instructor;
...

}

Usage:

List<Instructor> instructors = DaoManager.createDao(connection,
Instructor.class).queryForAll();
Is null: instructors.get(0).getPositions()

Thanks for the answer!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »