Hibernate entity Mapping template
1, write a comment? format:? attribute, which is the expression of this object with? Of Relationship. Example: "department attribute, this object and department's many-to-one" 2, copy Template:
Many-to-one |
<many-to-one name= "" class= "" column= ""/> |
one-to-many ( set |
<set Name= ""; <key Column= "" ></KEY> <one-to-many class= ""/> </SET> |
Many-to-many ( Set ) |
<set name= "" table= "" > <key column= "" ></key> <many-to-many class= "" column= ""/> </set> |
3, fill in the blanks:? Name property: Property name (the 1th question mark in the note)? Class Property: The associated entity type (the 2nd question mark in the note)? Column property:? <many-to-onecolumn= "..." Generally written as a property name plus an ID suffix, if the property is Department, the column value is written as DepartmentID. One-to-many <keycolumn= "..." : Copy the column value from the associated party (the other party is a many-to-one) mapping. <keycolumn= "..." Generally, the name of this object and the ID suffix can be written, if this object is named user, it is written as UserID. <many-to-manycolumn= "..." Generally, it can be written as the name of the associated object plus the ID suffix.
additions and deletions to the use of 6 a Action template for Method
/** list * /
Public String list () throws Exception {return"list";}
/** Delete * /
Public String Delete () throws Exception {return"toList";}
/** Add Page * /
Public String Addui ()throws Exception {return"saveui";}
/** Add * /
Public String Add () throws Exception {return"toList";}
/** Modify Page * /
Public String Editui ()throws Exception {return"saveui";}
/** Modify * /
Public String edit () throws Exception {return"toList";}