java - OneToMany and JoinColumn annotations is separate -
java - OneToMany and JoinColumn annotations is separate -
i'm using hibernate 3.2.1. in entity class i've seen annotations @onetomany , @joincolumns used together. these mean in separate? instance mean if annotated our entity class follows:
@entity @table(name = "player_account") public class playeraccount { @id @generatedvalue(strategy = generationtype.identity) @column(name = "id") private int id; @manytoone(targetentity = player.class, fetch = fetchtype.eager) //without @joincolumn private player player; //get, set }
please see says hibernate documentation it: http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html_single/ need 2.2.5.2. many-to-one section: @joincolumn attribute optional, default value(s) in 1 one, concatenation of name of relationship in owner side, _ (underscore), , name of primary key column in owned side.
java spring hibernate spring-mvc
Comments
Post a Comment