📄 book.java
字号:
package com.laoniu.bean;
import java.util.HashSet;
import java.util.Set;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
/**
* Book generated by MyEclipse - Hibernate Tools
*/
public class Book implements java.io.Serializable {
// Fields
private Long id;
private String name;
private Double price;
private Set orderlines = new HashSet(0);
// Constructors
/** default constructor */
public Book() {
}
/** full constructor */
public Book(String name, Double price, Set orderlines) {
this.name = name;
this.price = price;
this.orderlines = orderlines;
}
// Property accessors
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public Double getPrice() {
return this.price;
}
public void setPrice(Double price) {
this.price = price;
}
public Set getOrderlines() {
return this.orderlines;
}
public void setOrderlines(Set orderlines) {
this.orderlines = orderlines;
}
/* public static void main(String arg[]){
Book book=null;
Configuration config=new Configuration();
config.configure();
SessionFactory factory=config.buildSessionFactory();
Session session=factory.openSession();
Transaction tran=session.beginTransaction();
book=(Book)session.get(Book.class,new Long(1));
System.out.println(book.getName());
System.out.println(book.getId());
tran.commit();
session.close();
}*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -