1. 程式人生 > >Hibernate連線Oracle資料庫註解

Hibernate連線Oracle資料庫註解

@Entity public class House { @Id @SequenceGenerator(name= "seq",sequenceName="seq_house" ,allocationSize=1) @GeneratedValue(generator= "seq",strategy=GenerationType.SEQUENCE) private Integer id; @ManyToOne(fetch=FetchType. LAZY) @JoinColumn(name= "user_id") private User pubUser; @ManyToOne @JoinColumn
(name= "type_id")
private Type houseType; private String title; @Column(length=2000) private String description; private double price ; private Date pubDate; private double floorage ; @Column(length=100) private String contact; @ManyToOne @JoinColumn(name= "street_id") private Street street;