Java-EE Entity persisting

andrish

New Member
Currently i'm developing a round based game.now im encountering a problem:ive got 2 Objects: Flower and FlowerDynamic.Some (more or less) static attributes are getting assinged to the flower objects at the initialization. The flowerDynamics Object is the "dynamic" part of the application and changes after each round. in the "flowerState" (entity) class several flowers and flowerDynamics are managed. Now, after each round, the "flowerState" and these two objects need to be stored in the (relational) database.The question now is how do I make it most effective.I thought of 2 Lists, one containing all the Flowers and the other one containg all the "flowerDynamics". But maybe its more effecticve to use a hashMap.. i dont know..Perhaps you will better unterstand my problem if i show you some Code.. :\[code\]@Entityclass flowerState{@Idprivate Long id;... @ManyToMany(cascade=CascadeType.ALL)private LinkedList<Flower> flowers;@ManyToMany(cascade=CascadeType.ALL)private LinkedList<FlowerDynamics> flowerDynamics;}class flower{@Idprivate Long id;.. some attributes, getter and setter an stuff}class flowerDynamics{@Idprivate Long id;more attributes that are changing every round....}\[/code\]Thank for helping and sorry for my bad english :)
 
Top