I think I found it by using persistence.xml.
Thanks anyways
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159910#4159910
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159910
___
This can be done by adding hibernate.hbm2ddl.auto property for persistence-unit
in persistence.xml file.
It enable utomatic validation or export schema DDL to the database when the
SessionFactory is created. With create-drop, the database schema will be
dropped when the SessionFactory is closed