# How to map an entity to table using hibernate??

First of all, you have to create your application and connect to the database, for that you must click on        "**Application builder**" and then click "**configure database**" \[Fig. 1] and put information from your database \[Fig. 2]

![\[Fig1\] Application builder](https://4269523424-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBVX2OMafn-xpQ5esuM%2F-LIL9TL0AEiKaZThocWB%2F-LILLiFnbPVYp7jxaa8g%2Fimage.png?alt=media\&token=fd7fc402-4623-4b92-8b14-5f30a53c624e)

![\[Fig.2\] Configure database](https://4269523424-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBVX2OMafn-xpQ5esuM%2F-LIL9TL0AEiKaZThocWB%2F-LILNYE-R6m0GLumNE5E%2Fimage.png?alt=media\&token=6240a39e-39f2-4019-af23-befb4918f2dc)

Open eclipse, it is automatic  create the file with the the same name of your connection (hibernate\_app\_pg\_1). Open the file and map yours classes \[Fig. 3]&#x20;

![\[Fig. 3\] Hibernate mapping](https://4269523424-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBVX2OMafn-xpQ5esuM%2F-LIL9TL0AEiKaZThocWB%2F-LILQu6U7vOjnTpqth4c%2Fimage.png?alt=media\&token=2620ddda-5707-417d-b5ae-950067c6a13f)

Now, just create your class Teste and *Voilá* \[Fig. 4] And don't forget put your connection name on your classe \[Fig. 5]

![](https://4269523424-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBVX2OMafn-xpQ5esuM%2F-LIQD315X5avFLkTv_1P%2F-LIQriv_S-VUfb8qu-AC%2Fimage.png?alt=media\&token=a2629c5f-b0c6-48a9-b65a-78c1f3051e1e)

![\[Fig. 5\] Connection name](https://4269523424-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBVX2OMafn-xpQ5esuM%2F-LIQD315X5avFLkTv_1P%2F-LIQqhuekSwOASEUwV-2%2Fimage.png?alt=media\&token=86907b43-7873-4ce1-aeea-b5528e349654)

Then you can see your table created in your database \[Fig. 6]

![\[Fig. 6\] table teste on database](https://4269523424-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBVX2OMafn-xpQ5esuM%2F-LIQD315X5avFLkTv_1P%2F-LIQYgVFqjE3XitsCw77%2Fimage.png?alt=media\&token=da56db41-057e-4869-9372-c281aeef8956)
