Web hosting e commerce - CHAPTER 6 n MAPPING WITH ANNOTATIONS 109 n

CHAPTER 6 n MAPPING WITH ANNOTATIONS 109 n MAPPING WITH ANNOTATIONS 109 Listing 6-8. Using the @IdClass and @Id Annotations to Map a Compound Primary Key package com.hibernatebook.annotations; import javax.persistence.*; @Entity @IdClass(Account.AccountPk.class) public class Account { private String description; private String code; private Integer number; public Account(String description) { this.description = description; } protected Account() { } @Id public String getCode() { return this.code; } @Id public Integer getNumber() { return this.number; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } public void setNumber(Integer number) { this.number = number; } public void setCode(String code) { this.code = code; }
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision php5 hosting services

Leave a Reply