Hibernate連線Oracle資料庫註解
阿新 • • 發佈:2019-02-01
@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;