|
|
бет | 68/76 | Дата | 06.02.2022 | өлшемі | 0,67 Mb. | | #79506 | түрі | Лекция |
| Test - Test
- package logic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinTable; import javax.persistence.Table; import javax.persistence.JoinColumn; import org.hibernate.annotations.GenericGenerator; @Entity @Table(name="Test") public class Test { private Long tid; private String tname; public Test(){ tname = null; }
public Test(Test s){ tname = s.getTName(); } @Id @GeneratedValue(generator="increment") @GenericGenerator(name="increment", strategy = "increment") @Column(name="tid") public Long getTid() { return tid; } @Column(name="tname") public String getTName(){ return tname; } public void setId(Long i){ tid = i; } public void setTName(String s){ tname = s; } } - public Test(Test s){ tname = s.getTName(); } @Id @GeneratedValue(generator="increment") @GenericGenerator(name="increment", strategy = "increment") @Column(name="tid") public Long getTid() { return tid; } @Column(name="tname") public String getTName(){ return tname; } public void setId(Long i){ tid = i; } public void setTName(String s){ tname = s; } }
Достарыңызбен бөлісу: |
|
|