hibernate - JPA Mapping in Master/Detail Table Structure -


i have 2 tables : uploading : uid - primary key,autogenerated

public class uploading {     @id     @generatedvalue(strategy=generationtype.auto)     private long uid;      private string user;      @temporal(temporaltype.timestamp)        private date utime;      private string ustatus;      @onetomany(cascade = cascadetype.all,fetch = fetchtype.lazy)     @joincolumn(name="uid", referencedcolumnname="uid")     private list<snow> snow;  } 

and, snow: uid + incident- composite key

@embeddable  public class snowkey implements serializable {      private static final long serialversionuid = 1l;      private long uid;        private string incident;  }  public class snow {  @embeddedid     private snowkey key;     .......... } 

and, there many "snow" entries single "uploading" so, have used fetchtype.lazy. definition ok, if how can insert both tables now.

also can use bidirectional mapping ?


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -