Guest User

Untitled

a guest
Oct 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.39 KB | None | 0 0
  1. ott 17, 2018 3:51:33 PM org.hibernate.Version logVersion
  2. INFO: HHH000412: Hibernate Core {5.3.6.Final}
  3. ott 17, 2018 3:51:33 PM org.hibernate.cfg.Environment <clinit>
  4. INFO: HHH000206: hibernate.properties not found
  5. ott 17, 2018 3:51:35 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
  6. INFO: HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
  7. ott 17, 2018 3:51:35 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
  8. WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)
  9. ott 17, 2018 3:51:35 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
  10. INFO: HHH10001005: using driver [org.postgresql.Driver] at URL [jdbc:postgresql://localhost:5432/User_Configuration]
  11. ott 17, 2018 3:51:35 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
  12. INFO: HHH10001001: Connection properties: {user=postgres, password=****}
  13. ott 17, 2018 3:51:35 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
  14. INFO: HHH10001003: Autocommit mode: false
  15. ott 17, 2018 3:51:36 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections <init>
  16. INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
  17. ott 17, 2018 3:51:36 PM org.hibernate.dialect.Dialect <init>
  18. INFO: HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
  19. ott 17, 2018 3:51:36 PM org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl useContextualLobCreation
  20. INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
  21. ott 17, 2018 3:51:36 PM org.hibernate.type.BasicTypeRegistry register
  22. INFO: HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType@4004bfba
  23.  
  24. package Controller;
  25.  
  26. private static SessionFactory sessionFactory;
  27.  
  28. static{
  29. sessionFactory = new Configuration().configure("/hibernate.cfg.xml").buildSessionFactory();
  30. }
  31.  
  32. public static SessionFactory getSessionFactory(){
  33. return sessionFactory;
  34. }
  35.  
  36. package Controller;
  37.  
  38. import org.hibernate.Session;
  39. import org.hibernate.Transaction;
  40.  
  41. import Tables.User;
  42.  
  43. public class Test {
  44.  
  45. private static Session session;
  46.  
  47. public static void main(String[] args) {
  48.  
  49. session = HibernateUtils.getSessionFactory().openSession();
  50. Transaction tx = session.beginTransaction();
  51.  
  52. User user1 = new User("1","Bryan","Romero","123","mycode");
  53.  
  54. tx.commit();
  55. session.close();
  56.  
  57. System.exit(0);
  58. }
  59.  
  60. }
  61.  
  62. package Tables;
  63. // Generated 17-ott-2018 15.24.27 by Hibernate Tools 5.1.0.Alpha1
  64.  
  65. import javax.persistence.Column;
  66. import javax.persistence.Entity;
  67. import javax.persistence.Id;
  68. import javax.persistence.Table;
  69.  
  70. /**
  71. * User generated by hbm2java
  72. */
  73. @Entity
  74. @Table(name = "user", schema = "public")
  75. public class User implements java.io.Serializable {
  76.  
  77. @Id
  78. @Column(name="userid")
  79. private String userid;
  80.  
  81. @Column(name="name")
  82. private String name;
  83.  
  84. @Column(name="surname")
  85. private String surname;
  86.  
  87. @Column(name="password")
  88. private String password;
  89.  
  90. @Column(name="codice_fiscale")
  91. private String codiceFiscale;
  92.  
  93. public User() {
  94. }
  95.  
  96. public User(String userid) {
  97. this.userid = userid;
  98. }
  99.  
  100. public User(String userid, String name, String surname, String password, String codiceFiscale) {
  101. this.userid = userid;
  102. this.name = name;
  103. this.surname = surname;
  104. this.password = password;
  105. this.codiceFiscale = codiceFiscale;
  106. }
  107.  
  108. public String getUserid() {
  109. return this.userid;
  110. }
  111.  
  112. public void setUserid(String userid) {
  113. this.userid = userid;
  114. }
  115.  
  116. public String getName() {
  117. return this.name;
  118. }
  119.  
  120. public void setName(String name) {
  121. this.name = name;
  122. }
  123.  
  124. public String getSurname() {
  125. return this.surname;
  126. }
  127.  
  128. public void setSurname(String surname) {
  129. this.surname = surname;
  130. }
  131.  
  132. public String getPassword() {
  133. return this.password;
  134. }
  135.  
  136. public void setPassword(String password) {
  137. this.password = password;
  138. }
  139.  
  140. public String getCodiceFiscale() {
  141. return this.codiceFiscale;
  142. }
  143.  
  144. public void setCodiceFiscale(String codiceFiscale) {
  145. this.codiceFiscale = codiceFiscale;
  146. }
  147.  
  148. }
Add Comment
Please, Sign In to add comment