fixed buggy code example
git-svn-id: https://svn.jboss.org/repos/hibernate/trunk/Hibernate3/doc@8302 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
c5c2acc844
commit
7bb80888ca
|
@ -142,8 +142,8 @@ sess.save( pk, new Long(1234) );]]></programlisting>
|
|||
<programlisting><![CDATA[Cat fritz = (Cat) sess.load(Cat.class, generatedId);]]></programlisting>
|
||||
|
||||
<programlisting><![CDATA[// you need to wrap primitive identifiers
|
||||
long pkId = 1234;
|
||||
DomesticCat pk = (DomesticCat) sess.load( Cat.class, new Long(pkId) );]]></programlisting>
|
||||
long id = 1234;
|
||||
DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );]]></programlisting>
|
||||
|
||||
<para>
|
||||
Alternatively, you can load state into a given instance:
|
||||
|
|
|
@ -145,8 +145,8 @@ sess.save( pk, new Long(1234) );]]></programlisting>
|
|||
<programlisting><![CDATA[Cat fritz = (Cat) sess.load(Cat.class, generatedId);]]></programlisting>
|
||||
|
||||
<programlisting><![CDATA[// you need to wrap primitive identifiers
|
||||
long pkId = 1234;
|
||||
DomesticCat pk = (DomesticCat) sess.load( Cat.class, new Long(pkId) );]]></programlisting>
|
||||
long id = 1234;
|
||||
DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );]]></programlisting>
|
||||
|
||||
<para>
|
||||
Alternativamente, puedes cargar estado dentro de una instancia dada:
|
||||
|
|
|
@ -123,8 +123,8 @@ sess.save( pk, new Long(1234) );]]></programlisting>
|
|||
<programlisting><![CDATA[Cat fritz = (Cat) sess.load(Cat.class, generatedId);]]></programlisting>
|
||||
|
||||
<programlisting><![CDATA[// you need to wrap primitive identifiers
|
||||
long pkId = 1234;
|
||||
DomesticCat pk = (DomesticCat) sess.load( Cat.class, new Long(pkId) );]]></programlisting>
|
||||
long id = 1234;
|
||||
DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );]]></programlisting>
|
||||
|
||||
<para>
|
||||
다른 방법으로 당신은 주어진 인스턴스 속으로 상태를 로드시킬 수 있다:
|
||||
|
|
|
@ -123,8 +123,8 @@ sess.save( pk, new Long(1234) );]]></programlisting>
|
|||
<programlisting><![CDATA[Cat fritz = (Cat) sess.load(Cat.class, generatedId);]]></programlisting>
|
||||
|
||||
<programlisting><![CDATA[// you need to wrap primitive identifiers
|
||||
long pkId = 1234;
|
||||
DomesticCat pk = (DomesticCat) sess.load( Cat.class, new Long(pkId) );]]></programlisting>
|
||||
long id = 1234;
|
||||
DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );]]></programlisting>
|
||||
|
||||
<para>
|
||||
此外, 你可以把数据(state)加载到指定的对象实例上(覆盖掉该实例原来的数据)。
|
||||
|
|
Loading…
Reference in New Issue