Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. package com.finomatic.api.entity;
  2.  
  3. import java.io.Serializable;
  4.  
  5. import javax.persistence.Column;
  6. import javax.persistence.Entity;
  7. import javax.persistence.GeneratedValue;
  8. import javax.persistence.GenerationType;
  9. import javax.persistence.Id;
  10. import javax.persistence.Table;
  11.  
  12. @Entity
  13. @Table(name = "occupation_master")
  14. public class OccupationMaster implements Serializable{
  15.  
  16.  
  17. /**
  18. *
  19. */
  20. private static final long serialVersionUID = 1365314458098919671L;
  21.  
  22. @Id
  23. @GeneratedValue(strategy = GenerationType.AUTO)
  24. private Integer id;
  25.  
  26. @Column(name = "occupation_value")
  27. private String occupation_value;
  28.  
  29. public Integer getId() {
  30. return id;
  31. }
  32.  
  33. public void setId(Integer id) {
  34. this.id = id;
  35. }
  36.  
  37. public String getOccupation_value() {
  38. return occupation_value;
  39. }
  40.  
  41. public void setOccupation_value(String occupation_value) {
  42. this.occupation_value = occupation_value;
  43. }
  44. }
  45.  
  46. Session session = HibernateUtil.getSessionFactory().openSession();
  47. session.beginTransaction();
  48. String hql = "from OccupationMaster";
  49. Query query = session.createQuery(hql);
  50. List<OccupationMaster> list = query.list();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement