Pozn. lze to nastavit i globalne (v persistence.xml)

2010/4/29 Rastislav Siekel <sie...@prosoft.sk>:
> Malo by pomôcť nastaviť dynamic-insert="true" a dynamic-update="true".
>
> Nejako takto:
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC
>         "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
>         "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd";>
> <hibernate-mapping>
>     <class name="xx.yy.Zzz" table="xyz" dynamic-insert="true"
> dynamic-update="true">
> ...
>
> Rastislav "Bedo" Siekel
>
>
> ________________________________
> Ing. Rastislav Siekel
> Prosoft s.r.o., Kuzmányho 8, 010 01 Žilina, Slovakia
> E-mail : <sie...@prosoft.sk>
> Tel : 041/562 54 91
> Fax : 041/562 54 97
> Mobil : 0905 34 00 20
> On 29. 4. 2010 15:07, Dusan Zatkovsky wrote:
>
> Ahoj.
>
> Sorry ze zase otravujem, ale toto mi vrta v hlave:
>
>        EntityManagerFactory fact =
> Persistence.createEntityManagerFactory("testPU");
>
>         EntityManager m = fact.createEntityManager();
>         m.getTransaction().begin();
>
>         E e1 = new E();
>         e1.setA("a");
>         e1.setB("b");
>         e1.setC("c");
>         e1.setD("d");
>         m.persist(e1);
>
>         m.getTransaction().commit();
>
> //:: vola "insert into E (id, a, b, c, d) values (null, ?, ?, ?, ?)"
>
>         m.getTransaction().begin();
>
>         e1.setB("2");
>         //m.merge(e1);
>
>         m.getTransaction().commit();
>
> //:: vola  "update E set a=?, b=?, c=?, d=? where id=?"
>
>         m.close();
>
> Ten update je kravina, preco nevola jednoducho
> "update E set b=? where id=?"
>
> Zle som niekde nieco nastavil?
>
> Diky
>
>



-- 
Ondra Medek

Odpovedet emailem