📄 locationwithmultipleaddresses.java
字号:
package com.manning.hq.ch09;
import java.io.Serializable;
/**
* To make the hibernate.componet prefix tags to work, make sure Address's field are using hibernate.column tags to
* supplement their hibernate.property tags.
*
* @hibernate.class table="locations_with_multiple_addresses"
*/
public class LocationWithMultipleAddresses implements Serializable{
private Long id;
private String name;
private Address mailingAddress = new Address();
private Address billingAddress = new Address();
/**
* @hibernate.id generator-class="native" column="uid"
* @return
*/
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
/**
* @hibernate.property
* @return
*/
public String getName() { return name; }
public void setName(String name) { this.name = name; }
/**
* @hibernate.component prefix="mailing_"
* @return
*/
public Address getMailingAddress() { return mailingAddress; }
public void setMailingAddress(Address mailingAddress) { this.mailingAddress = mailingAddress;}
/**
* @hibernate.component prefix="billing_"
* @return
*/
public Address getBillingAddress() { return billingAddress; }
public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -