Hello. 

Here's the problem.  An 'Annotation' has a list of 'Tag'. What I want to do 
is when persisting an annotation (with its list of Tag) I dont want to 
persist the Tags of the annotations. For example, lets say I previously 
persisted 3 tags:  Tag1 Tag2 Tag3.  And now I persist an annotations with a 
list of tag: Tag1 and Tag2.

In the table Tag will appear: Tag1, Tag2,Tag3,Tag1,Tag2.  

Here's the code:

@Entity
@Table(name = "annotation")
public class Annotation implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Key id;
    @Basic
    @OneToMany(mappedBy = "annotation", cascade = CascadeType.ALL)
    private ArrayList<AnnotationHasTag> annotationHasTags;

//setters and getters

@Entity
@Table(name = "annotation_has_tag")
public class AnnotationHasTag implements Serializable, IsSerializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Key id;
    @Basic
    @ManyToOne
    private Annotation annotation;
    @Basic
    @ManyToOne
    private Tag tag;

//setters and getters

@Entity
@Table(name = "tag")
public class Tag implements Serializable, IsSerializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Key id;
    @Basic
    private String name;
 
//setters and getters.



Please Help me out, It's been 5 days now. I'm stuck.

I'll try any kind of suggestions.

Thank you in advance.

Kido.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to