0% found this document useful (0 votes)
11 views

@entity Selectam @id Selectam: Import Import

Uploaded by

Diana Hartan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

@entity Selectam @id Selectam: Import Import

Uploaded by

Diana Hartan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Eclipse->New Java Project

Click dreapta pe proiect ->BuildPath->Libraries->Classpath->Add new library->User Library->hibernate-


>Add Jars .

Selectam din hibernate-distribution-3.6.10.Final :

-hibernate 3.jar

-add JAR->folder lib->required

-add JAR->folder lib->jpa

-add JAR->folder lib->bytecode->Javaassist

Download PostgreSQL JDBC Driver pe care il adaugam in BuildPath

New File->Xml Filehibernate.cfg.xml pe care il salvam in src.

@Entity selectam import javax.persistence.Entity;

@Id selectam import javax.persistence.Entity;


@Table (name = “NUME TABEL “)

@Basic

@Transient-ascunde coloanal

@Temporal (TemporalType.DATE)

@Lob -large object

SessionFactory sessionFactory = new


Configuration().configure().buildSessionFactory(); //buildSessionFactory()-return a
session factory
Session session = sessionFactory.openSession();
session.beginTransaction();
session.save(user);
session.getTransaction().commit();

You might also like