[RESOLVIDO]Configurar persistence.xml via código - Hibernate Annotations

Olá a todos,

Alguém saberia me dizer como eu configuro o arquivo persistence.xml via código?

obrigado

Eai matheus…

Cara acho que você se confundiu… o que você não quer é configurar os mapeamentos em xml? o xml que faz o mapeamento é o ORM.xml. Pra começar com JPA/Hibernate dá uma olhada nesse screencast que ajuda.
http://blog.caelum.com.br/video/jpa/beginning-with-jpa.html

abraço

isso ae rafael…

o que eu queria era a parte que configura as propriedades do persistence.xml via código java:

    EntityManagerFactory emf;
    EntityManager em = null;
    
    Map prop = new HashMap();
    prop.put("hibernate.hbm2ddl.auto", "create-drop");
    prop.put("hibernate.hbm2ddl.auto", "update");
    prop.put("hibernate.format_sql", "true");
    //SQL-SERVER
    prop.put("hibernate.dialect", "org.hibernate.dialect.SQLServerDialect");
    prop.put("hibernate.connection.driver_class", "net.sourceforge.jtds.jdbc.Driver");
    prop.put("hibernate.connection.url", "jdbc:jtds:sqlserver://localhost:1433/my_banco");
    prop.put("hibernate.connection.username", "user");
    prop.put("hibernate.connection.password", "password");
    prop.put("hibernate.c3p0.min_size", "3");
    prop.put("hibernate.c3p0.max_size", "10");
    prop.put("hibernate.c3p0.timeout", "200");
    prop.put("hibernate.c3p0.max_statements", "40");

    emf = Persistence.createEntityManagerFactory("testando", prop);
    em = emf.createEntityManager();

mas a vídeo aula que vc passou é sensacional…hehehehe
vlw
abraço