Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ott 17, 2018 3:51:33 PM org.hibernate.Version logVersion
- INFO: HHH000412: Hibernate Core {5.3.6.Final}
- ott 17, 2018 3:51:33 PM org.hibernate.cfg.Environment <clinit>
- INFO: HHH000206: hibernate.properties not found
- ott 17, 2018 3:51:35 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
- INFO: HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
- ott 17, 2018 3:51:35 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
- WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)
- ott 17, 2018 3:51:35 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
- INFO: HHH10001005: using driver [org.postgresql.Driver] at URL [jdbc:postgresql://localhost:5432/User_Configuration]
- ott 17, 2018 3:51:35 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
- INFO: HHH10001001: Connection properties: {user=postgres, password=****}
- ott 17, 2018 3:51:35 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
- INFO: HHH10001003: Autocommit mode: false
- ott 17, 2018 3:51:36 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections <init>
- INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
- ott 17, 2018 3:51:36 PM org.hibernate.dialect.Dialect <init>
- INFO: HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
- ott 17, 2018 3:51:36 PM org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl useContextualLobCreation
- INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
- ott 17, 2018 3:51:36 PM org.hibernate.type.BasicTypeRegistry register
- INFO: HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType@4004bfba
- package Controller;
- private static SessionFactory sessionFactory;
- static{
- sessionFactory = new Configuration().configure("/hibernate.cfg.xml").buildSessionFactory();
- }
- public static SessionFactory getSessionFactory(){
- return sessionFactory;
- }
- package Controller;
- import org.hibernate.Session;
- import org.hibernate.Transaction;
- import Tables.User;
- public class Test {
- private static Session session;
- public static void main(String[] args) {
- session = HibernateUtils.getSessionFactory().openSession();
- Transaction tx = session.beginTransaction();
- User user1 = new User("1","Bryan","Romero","123","mycode");
- tx.commit();
- session.close();
- System.exit(0);
- }
- }
- package Tables;
- // Generated 17-ott-2018 15.24.27 by Hibernate Tools 5.1.0.Alpha1
- import javax.persistence.Column;
- import javax.persistence.Entity;
- import javax.persistence.Id;
- import javax.persistence.Table;
- /**
- * User generated by hbm2java
- */
- @Entity
- @Table(name = "user", schema = "public")
- public class User implements java.io.Serializable {
- @Id
- @Column(name="userid")
- private String userid;
- @Column(name="name")
- private String name;
- @Column(name="surname")
- private String surname;
- @Column(name="password")
- private String password;
- @Column(name="codice_fiscale")
- private String codiceFiscale;
- public User() {
- }
- public User(String userid) {
- this.userid = userid;
- }
- public User(String userid, String name, String surname, String password, String codiceFiscale) {
- this.userid = userid;
- this.name = name;
- this.surname = surname;
- this.password = password;
- this.codiceFiscale = codiceFiscale;
- }
- public String getUserid() {
- return this.userid;
- }
- public void setUserid(String userid) {
- this.userid = userid;
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getSurname() {
- return this.surname;
- }
- public void setSurname(String surname) {
- this.surname = surname;
- }
- public String getPassword() {
- return this.password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- public String getCodiceFiscale() {
- return this.codiceFiscale;
- }
- public void setCodiceFiscale(String codiceFiscale) {
- this.codiceFiscale = codiceFiscale;
- }
- }
Add Comment
Please, Sign In to add comment