I have a problem with create a table from @Entity class automatically. When I create table manually everything is ok. I can inject entityManager so on. I found many solution like this but doesn't work for me. My configuration:
persistence.xml
    <persistence-unit name="entityManagerFactory"
    transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>java:jdbc/oracleTest</jta-data-source>
    <class>pl.example.was.test.entity.ResourceEntity</class>
    <properties>
        <property name="packagesToScan" value="pl.example.was.test.entity" />
        <property name="hibernate.archive.autodetection" value="class, hbm" />
        <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect" />
        <property name="hibernate.hbm2ddl.auto" value="create-drop" />
        <property name="show_sql" value="true" />
        <property name="format_sql" value="true" />
        <property name="hibernate.hbm2ddl.auto" value="true" />
        <property name="hibernate.transaction.factory_class"
            value="org.hibernate.transaction.CMTTransactionFactory" />
        <property name="hibernate.transaction.manager_lookup_class"
            value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup" />
    </properties>
</persistence-unit>
part of Entity class
@Entity
 public class ResourceEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
// getters setters //
Inject EntityManager
@PersistenceContext
private EntityManager em;
I'm creating two test method
public void addResource(ResourceEntity selectedResource, Locale locale) {
    selectedResource.setLocale(locale.toString());
    try{
    Session session = em.unwrap(Session.class);
    Transaction tx = session.beginTransaction();
    session.save(selectedResource);
    session.flush();
    session.clear();
    tx.commit();
    session.close();
    }catch (Exception ex){
        ex.printStackTrace();
    }
}
and
public void addResource2(ResourceEntity selectedResource, Locale locale) {
    selectedResource.setLocale(locale.toString());
    em.persist(selectedResource);
}
I'm reading that I have to create Session object or EntityManager after that  tables are  creating automatically, but not in my case. 
My hibernate dependecies
<dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>4.2.7.Final</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>4.2.7.Final</version>
    </dependency>
somebody have any idea?
Thanks for help
 
     
    