You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(22) |
Nov
(308) |
Dec
(131) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(369) |
Feb
(171) |
Mar
(236) |
Apr
(187) |
May
(218) |
Jun
(217) |
Jul
(127) |
Aug
(448) |
Sep
(270) |
Oct
(231) |
Nov
(422) |
Dec
(255) |
2004 |
Jan
(111) |
Feb
(73) |
Mar
(338) |
Apr
(351) |
May
(349) |
Jun
(495) |
Jul
(394) |
Aug
(1048) |
Sep
(499) |
Oct
(142) |
Nov
(269) |
Dec
(638) |
2005 |
Jan
(825) |
Feb
(1272) |
Mar
(593) |
Apr
(690) |
May
(950) |
Jun
(958) |
Jul
(767) |
Aug
(839) |
Sep
(525) |
Oct
(449) |
Nov
(585) |
Dec
(455) |
2006 |
Jan
(603) |
Feb
(656) |
Mar
(195) |
Apr
(114) |
May
(136) |
Jun
(100) |
Jul
(128) |
Aug
(68) |
Sep
(7) |
Oct
(1) |
Nov
(1) |
Dec
(8) |
2007 |
Jan
(4) |
Feb
(3) |
Mar
(8) |
Apr
(16) |
May
(5) |
Jun
(4) |
Jul
(6) |
Aug
(23) |
Sep
(15) |
Oct
(5) |
Nov
(7) |
Dec
(5) |
2008 |
Jan
(5) |
Feb
(1) |
Mar
(1) |
Apr
(5) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <one...@us...> - 2003-03-29 10:13:36
|
Update of /cvsroot/hibernate/Hibernate2 In directory sc8-pr-cvs1:/tmp/cvs-serv31686 Modified Files: build.xml Log Message: minor changes Index: build.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/build.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** build.xml 27 Mar 2003 23:18:48 -0000 1.12 --- build.xml 29 Mar 2003 10:13:33 -0000 1.13 *************** *** 231,235 **** </target> ! <target name="refdoc" depends="docpdf,dochtml,dochtmlsingle" description="Generate and copy reference documentation"> <copy todir="${basedir}/${dist.ref.dir}"> <fileset dir="${basedir}/${doc.ref.dir}"> --- 231,235 ---- </target> ! <target name="refdoc" depends="dochtml,dochtmlsingle,docpdf" description="Generate and copy reference documentation"> <copy todir="${basedir}/${dist.ref.dir}"> <fileset dir="${basedir}/${doc.ref.dir}"> *************** *** 267,271 **** </target> ! <target name="dist" depends="jar,wikidoc,javadoc,refdoc,copysource,copylib,extras" description="Build everything"> <zip zipfile = "${dist.dir}.zip"> <zipfileset prefix="${name}-${version}" dir="${dist.dir}"/> --- 267,271 ---- </target> ! <target name="dist" depends="jar,javadoc,copysource,copylib,extras,refdoc,wikidoc" description="Build everything"> <zip zipfile = "${dist.dir}.zip"> <zipfileset prefix="${name}-${version}" dir="${dist.dir}"/> |
Update of /cvsroot/hibernate/Hibernate2/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv22330/reference/src Modified Files: advanced_or_mapping.xml basic_or_mapping.xml persistent_classes.xml session_configuration.xml Log Message: updated to cover latest features Index: advanced_or_mapping.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/advanced_or_mapping.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** advanced_or_mapping.xml 27 Mar 2003 11:29:38 -0000 1.11 --- advanced_or_mapping.xml 29 Mar 2003 09:51:27 -0000 1.12 *************** *** 1170,1173 **** --- 1170,1186 ---- </para> + <para> + Sometimes we need to ensure that a proxy or collection is initialized before closing the + <literal>Session</literal>. Of course, we can alway force initialization by calling + <literal>cat.getSex()</literal> or <literal>cat.getKittens().size()</literal>, for example. + But that is confusing to readers of the code and is not convenient for generic code. + The static methods <literal>Hibernate.initialize()</literal> and <literal>Hibernate.isInitialized()</literal> + provide the application with a convenient way of working with lazyily initialized collections or + proxies. <literal>Hibernate.initialize(cat)</literal> will force the initialization of a proxy, + <literal>cat</literal>, as long as its <literal>Session</literal> is still open. + <literal>Hibernate.initialize( cat.getKittens() )</literal> has a similar effect for the collection + of kittens. + </para> + </sect1> Index: basic_or_mapping.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/basic_or_mapping.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** basic_or_mapping.xml 23 Feb 2003 13:53:24 -0000 1.9 --- basic_or_mapping.xml 29 Mar 2003 09:51:27 -0000 1.10 *************** *** 28,32 **** <property name="birthdate" type="date"/> <property name="color" not-null="true"/> ! <property name="sex" not-null="true"/> <property name="weight"/> <many-to-one name="mate" column="mate_id"/> --- 28,32 ---- <property name="birthdate" type="date"/> <property name="color" not-null="true"/> ! <property name="sex" not-null="true" update="false"/> <property name="weight"/> <many-to-one name="mate" column="mate_id"/> *************** *** 71,83 **** <para> ! This element has just two optional attributes. The <literal>schema</literal> attribute specifies that tables referred to by this mapping belong to the named schema. If specified, tablenames will be qualified by the given schema name. If missing, tablenames will be unqualified. The <literal>default-cascade</literal> attribute specifies what cascade style should be assumed for properties and collections which do not specify a ! <literal>cascade</literal> attribute. If missing, the default is <literal>none</literal> ! (see below). </para> ! </sect2> <sect2 id="or-mapping-s1-3"> --- 71,118 ---- <para> ! This element has three optional attributes. The <literal>schema</literal> attribute specifies that tables referred to by this mapping belong to the named schema. If specified, tablenames will be qualified by the given schema name. If missing, tablenames will be unqualified. The <literal>default-cascade</literal> attribute specifies what cascade style should be assumed for properties and collections which do not specify a ! <literal>cascade</literal> attribute. The <literal>auto-import</literal> attribute lets us ! use unqualified class names in the query language, by default. </para> ! ! <programlistingco> ! <areaspec> ! <area id="hm1" coords="2 55"/> ! <area id="hm2" coords="3 55" /> ! <area id="hm3" coords="4 55"/> ! </areaspec> ! <programlisting><![CDATA[<class ! schema="schemaName" ! default-cascade="none|save-update" ! auto-import="true|false" ! />]]></programlisting> ! <calloutlist> ! <callout arearefs="hm1"> ! <para> ! <literal>schema</literal> (optional): The name of a database schema. ! </para> ! </callout> ! <callout arearefs="hm2"> ! <para> ! <literal>default-cascade</literal> (optional - defaults to <literal>none</literal>): ! A default cascade style. ! </para> ! </callout> ! <callout arearefs="hm3"> ! <para> ! <literal>auto-import</literal> (optional - defaults to <literal>true</literal>): ! Specifies whether we can use unqualified class names (of classes in this mapping) ! in the query language. ! </para> ! </callout> ! </calloutlist> ! </programlistingco> ! ! ! </sect2> <sect2 id="or-mapping-s1-3"> *************** *** 1100,1103 **** --- 1135,1175 ---- </sect2> + <sect2 id="or-mapping-s1-13"> + <title>import</title> + + <para> + Suppose your application has two persistent classes with the same name, and you don't want to + specify the fully qualified (package) name in Hibernate queries. Classes may be "imported" + explicitly, rather than relying upon <literal>auto-import="true"</literal>. You may even import classes + and interfaces that are not explicitly mapped. + </para> + + <programlisting><![CDATA[<import class="java.lang.Object" rename="Universe"/>]]></programlisting> + + <programlistingco> + <areaspec> + <area id="import1" coords="2 55"/> + <area id="import2" coords="3 55"/> + </areaspec> + <programlisting><![CDATA[<import + class="ClassName" + rename="ShortName" + />]]></programlisting> + <calloutlist> + <callout arearefs="import1"> + <para> + <literal>class</literal>: The fully qualified class name of of any Java class. + </para> + </callout> + <callout arearefs="import2"> + <para> + <literal>rename</literal> (optional - defaults to the unqualified class name): + A name that may be used in the query language. + </para> + </callout> + </calloutlist> + </programlistingco> + + </sect2> </sect1> *************** *** 1355,1373 **** <sect2 id="or-mapping-s2-5"> ! <title>The object type</title> <para> ! There is one further type allowed for a property mapping. The <literal>object</literal> ! type maps entities to two columns. The first column holds the class name. The second holds ! the serialized identifier. This type is intended to allow heterogeneous collections and ! properties of type <literal>java.lang.Object</literal> whose values might come from ! different tables. It is most certainly not meant as the usual way of mapping (polymorphic) ! associations. You should use this only in very special cases. </para> ! <programlisting><![CDATA[<property name="anyEntity" type="object"> <column name="class_name"/> <column name="id"/> ! </property>]]></programlisting> </sect2> --- 1427,1451 ---- <sect2 id="or-mapping-s2-5"> ! <title>Any type mappings</title> <para> ! There is one further type of property mapping. The <literal><any></literal> mapping element ! defines a polymorphic association to classes from multiple tables. This type of mapping always ! requires more than one column. The first column holds the class name of the associated entity. ! The remaining columns hold the identifier. It is impossible to specify a foreign key constraint ! for this kind of association, so this is most certainly not meant as the usual way of mapping ! (polymorphic) associations. You should use this only in very special cases (eg. audit logs, ! user session data, etc). </para> ! <programlisting><![CDATA[<any name="anyEntity" id-type="long"> <column name="class_name"/> <column name="id"/> ! </any>]]></programlisting> ! ! <para> ! The old <literal>object</literal> type from Hibernate 1.2 is still supported, but is ! semi-deprecated. ! </para> </sect2> Index: persistent_classes.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/persistent_classes.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** persistent_classes.xml 29 Mar 2003 04:22:48 -0000 1.3 --- persistent_classes.xml 29 Mar 2003 09:51:27 -0000 1.4 *************** *** 283,286 **** --- 283,404 ---- </para> </sect1> + + <sect1 id="persistent-classes-s5"> + <title>XDoclet Example</title> + <para> + In the next section we will show how Hibernate mappings may be expressed using + a simple, readable XML format. Many Hibernate users prefer to embed mapping + information directly in sourcecode using XDoclet <literal>@hibernate.tags</literal>. + We will not cover this approach in this document, since strictly it is considered + part of XDoclet. However, we include the following example of the <literal>Cat</literal> + class with XDoclet mappings. + </para> + + <programlisting><![CDATA[package eg; + import java.util.Set; + import java.util.Date; + + /** + * @hibernate.class + * table="CATS" + */ + public class Cat { + private Long id; // identifier + private Date birthdate; + private Cat mate; + private Set kittens + private Color color; + private char sex; + private float weight; + + /** + * @hibernate.id + * generator-class="native" + * column="CAT_ID" + */ + public Long getId() { + return id; + } + private void setId(Long id) { + this.id=id; + } + + /** + * @hibernate.many-to-one + * column="MATE_ID" + */ + public Cat getMate() { + return mate; + } + void setMate(Cat mate) { + this.mate = mate; + } + + /** + * @hibernate.property + * column="BIRTH_DATE" + */ + public Date getBirthdate() { + return birthdate; + } + void setBirthdate(Date date) { + birthdate = date; + } + /** + * @hibernate.property + * column="WEIGHT" + */ + public float getWeight() { + return weight; + } + void setWeight(float weight) { + this.weight = weight; + } + + /** + * @hibernate.property + * column="COLOR" + * not-null="true" + */ + public Color getColor() { + return color; + } + void setColor(Color color) { + this.color = color; + } + /** + * @hibernate.set + * lazy="true" + * order-by="BIRTH_DATE" + * @hibernate.collection-key + * column="PARENT_ID" + * @hibernate.collection-one-to-many + */ + public Set getKittens() { + return kittens; + } + void setKittens(Set kittens) { + this.kittens = kittens; + } + // addKitten not needed by Hibernate + public void addKitten(Cat kitten) { + kittens.add(kitten); + } + + /** + * @hibernate.property + * column="SEX" + * not-null="true" + * update="false" + */ + public char getSex() { + return sex; + } + void setSex(char sex) { + this.sex=sex; + } + }]]></programlisting> + + </sect1> </chapter> Index: session_configuration.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/session_configuration.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** session_configuration.xml 23 Feb 2003 13:53:24 -0000 1.7 --- session_configuration.xml 29 Mar 2003 09:51:27 -0000 1.8 *************** *** 2,5 **** --- 2,12 ---- <title>SessionFactory Configuration</title> + + <para> + Because Hibernate is designed to operate in many different environments, there + are a large number of configuration parameters. Fortunately, most have sensible + default values and Hibernate is distributed with an example + <literal>hibernate.properties</literal> file that shows the various options. + </para> <sect1 id="session-configuration-s1"> *************** *** 460,478 **** <row> <entry> - <literal>hibernate.query.imports</literal> - </entry> - <entry> - A list of packages containing persistent classes. If the package is - listed here, your Hibernate queries need not specify the full class name of a - persistent class. (You can use <literal>from foo in class Foo</literal> as an - alternative to <literal>from foo in class eg.foo.Foo</literal>.) - <para> - <emphasis role="strong">Value:</emphasis> - <literal>package.name, other.package.name</literal> - </para> - </entry> - </row> - <row> - <entry> <literal>hibernate.query.substitutions</literal> </entry> --- 467,470 ---- *************** *** 502,506 **** </tgroup> </table> ! <para> You should always set the <literal>hibernate.dialect</literal> property to the correct --- 494,501 ---- </tgroup> </table> ! ! <sect2 id="session-configuration-s5-1"> ! <title>SQL Dialects</title> ! <para> You should always set the <literal>hibernate.dialect</literal> property to the correct *************** *** 564,571 **** --- 559,576 ---- <entry>Microsoft SQL Server</entry> <entry><literal>net.sf.hibernate.dialect.SybaseDialect</literal></entry> </row> + <row> + <entry>Ingres</entry> <entry><literal>net.sf.hibernate.dialect.IngresDialect</literal></entry> + </row> + <row> + <entry>FrontBase</entry> <entry><literal>net.sf.hibernate.dialect.FrontbaseDialect</literal></entry> + </row> </tbody> </tgroup> </table> + </sect2> + <sect2 id="session-configuration-s5-2"> + <title>Outer Join Fetching</title> + <para> If your database supports ANSI or Oracle style outerjoins, <emphasis>outer join *************** *** 578,582 **** by setting <literal>outer-join="false"</literal>. </para> ! <para> Oracle limits the size of <literal>byte</literal> arrays that may --- 583,592 ---- by setting <literal>outer-join="false"</literal>. </para> ! ! </sect2> ! ! <sect2 id="session-configuration-s5-3"> ! <title>Binary Streams</title> ! <para> Oracle limits the size of <literal>byte</literal> arrays that may *************** *** 586,595 **** --- 596,613 ---- <emphasis>This is a JVM-level setting only.</emphasis> </para> + </sect2> + <sect2 id="session-configuration-s5-4"> + <title>SQL Logging to Console</title> + <para> <literal>hibernate.show_sql</literal> forces Hibernate to write SQL statements to the console. This is provided as an easy alternative to enabling logging. </para> + </sect2> + <sect2 id="session-configuration-s5-5"> + <title>Custom <literal>ConnectionProvider</literal></title> + <para> You may define your own plugin strategy for obtaining JDBC connections by *************** *** 599,603 **** --- 617,625 ---- <literal>hibernate.connection.provider_class</literal>. </para> + </sect2> + <sect2 id="session-configuration-s5-6"> + <title>Transaction Strategy</title> + <para> If you wish to use the Hibernate <literal>Transaction</literal> API, you must *************** *** 623,627 **** <para> ! You may also define your own. </para> --- 645,650 ---- <para> ! You may also define your own transaction strategies (for a CORBA transaction service, ! for example). </para> *************** *** 663,670 **** <entry align="center">Resin</entry> </row> </tbody> </tgroup> </table> ! <para> If you wish to have the <literal>SessionFactory</literal> bound to a JNDI namespace, specify --- 686,702 ---- <entry align="center">Resin</entry> </row> + <row> + <entry><literal>net.sf.hibernate.transaction.JRun4TransactionManagerLookup</literal></entry> + <entry align="center">JRun4</entry> + </row> </tbody> </tgroup> </table> ! </sect2> ! ! <sect2 id="session-configuration-s5-7"> ! <title>JNDI-bound <literal>SessionFactory</literal></title> ! ! <para> If you wish to have the <literal>SessionFactory</literal> bound to a JNDI namespace, specify *************** *** 675,679 **** an initial context. </para> ! <para> You may define new Hibernate query tokens using <literal>hibernate.query.substitutions</literal>. --- 707,715 ---- an initial context. </para> ! </sect2> ! ! <sect2 id="session-configuration-s5-8"> ! <title>Query Language Substitution</title> ! <para> You may define new Hibernate query tokens using <literal>hibernate.query.substitutions</literal>. *************** *** 690,695 **** <para> ! would allow you to rename the SQL <literal>lower</literal> function. </para> </sect1> --- 726,733 ---- <para> ! would allow you to rename the SQL <literal>LOWER</literal> function. </para> + + </sect2> </sect1> *************** *** 702,706 **** An alternative approach is to specify a full configuration in a file named <literal>hibernate.cfg.xml</literal>. The configuration file is expected to ! be in the root of your CLASSPATH. </para> --- 740,744 ---- An alternative approach is to specify a full configuration in a file named <literal>hibernate.cfg.xml</literal>. The configuration file is expected to ! be in the root of your <literal>CLASSPATH</literal>. </para> |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv3374/hibernate/test Modified Files: ABC.hbm.xml ABCProxy.hbm.xml Baz.hbm.xml Blobber.hbm.xml Blobber.java Category.hbm.xml Circular.hbm.xml Container.hbm.xml Custom.hbm.xml Fee.hbm.xml Fo.hbm.xml FooBar.hbm.xml Fum.hbm.xml Fumm.hbm.xml Glarch.hbm.xml Holder.hbm.xml Immutable.hbm.xml Location.hbm.xml Many.hbm.xml MasterDetail.hbm.xml Multi.hbm.xml Nameable.hbm.xml One.hbm.xml ParentChild.hbm.xml ParentChildTest.java Qux.hbm.xml Simple.hbm.xml SingleSeveral.hbm.xml Stuff.hbm.xml Vetoer.hbm.xml Log Message: re-reworked import functionality Index: ABC.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ABC.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ABC.hbm.xml 29 Mar 2003 04:08:48 -0000 1.5 --- ABC.hbm.xml 29 Mar 2003 07:36:22 -0000 1.6 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.A" import="A" discriminator-value="0"> <id name = "id" unsaved-value = "null"> <generator class="vm"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.A" discriminator-value="0"> <id name = "id" unsaved-value = "null"> <generator class="vm"/> *************** *** 9,13 **** <discriminator column="clazz" type="integer" not-null="false"/> <property name="name"/> ! <subclass name="net.sf.hibernate.test.B" import="B" discriminator-value="-1"> <property name="count" column="count_"/> <subclass name="net.sf.hibernate.test.C1" discriminator-value="null"> --- 9,13 ---- <discriminator column="clazz" type="integer" not-null="false"/> <property name="name"/> ! <subclass name="net.sf.hibernate.test.B" discriminator-value="-1"> <property name="count" column="count_"/> <subclass name="net.sf.hibernate.test.C1" discriminator-value="null"> *************** *** 21,25 **** </class> ! <class name="net.sf.hibernate.test.D" discriminator-value="0" import="D" proxy="net.sf.hibernate.test.D"> <id name = "id" unsaved-value = "null"> <generator class="assigned"/> --- 21,25 ---- </class> ! <class name="net.sf.hibernate.test.D" discriminator-value="0" proxy="net.sf.hibernate.test.D"> <id name = "id" unsaved-value = "null"> <generator class="assigned"/> Index: ABCProxy.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ABCProxy.hbm.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ABCProxy.hbm.xml 29 Mar 2003 04:08:48 -0000 1.6 --- ABCProxy.hbm.xml 29 Mar 2003 07:36:22 -0000 1.7 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.A" discriminator-value="0" import="A" proxy="net.sf.hibernate.test.A"> <id name = "id" unsaved-value = "null"> <generator class="vm"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.A" discriminator-value="0" proxy="net.sf.hibernate.test.A"> <id name = "id" unsaved-value = "null"> <generator class="vm"/> *************** *** 9,19 **** <discriminator column="clazz" type="integer" force="true" not-null="false"/> <property name="name"/> ! <subclass name="net.sf.hibernate.test.B" discriminator-value="null" import="B" proxy="net.sf.hibernate.test.B"> <property name="count" column="count_"/> ! <subclass name="net.sf.hibernate.test.C1" discriminator-value="1" import="C1" proxy="net.sf.hibernate.test.C1"> <property name="address" column="c1"/> <one-to-one name="d"/> </subclass> ! <subclass name="net.sf.hibernate.test.C2" discriminator-value="2" import="C2" proxy="net.sf.hibernate.test.C2"> <property name="address" column="c2"/> </subclass> --- 9,19 ---- <discriminator column="clazz" type="integer" force="true" not-null="false"/> <property name="name"/> ! <subclass name="net.sf.hibernate.test.B" discriminator-value="null" proxy="net.sf.hibernate.test.B"> <property name="count" column="count_"/> ! <subclass name="net.sf.hibernate.test.C1" discriminator-value="1" proxy="net.sf.hibernate.test.C1"> <property name="address" column="c1"/> <one-to-one name="d"/> </subclass> ! <subclass name="net.sf.hibernate.test.C2" discriminator-value="2" proxy="net.sf.hibernate.test.C2"> <property name="address" column="c2"/> </subclass> *************** *** 21,25 **** </class> ! <class name="net.sf.hibernate.test.D" discriminator-value="0" proxy="net.sf.hibernate.test.D" import="D"> <id name = "id" unsaved-value = "null"> <generator class="assigned"/> --- 21,25 ---- </class> ! <class name="net.sf.hibernate.test.D" discriminator-value="0" proxy="net.sf.hibernate.test.D"> <id name = "id" unsaved-value = "null"> <generator class="assigned"/> Index: Baz.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Baz.hbm.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Baz.hbm.xml 29 Mar 2003 04:08:49 -0000 1.13 --- Baz.hbm.xml 29 Mar 2003 07:36:22 -0000 1.14 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Baz" import="Baz" > <id name="code" type="string"> <column name="baz_id" length="32"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Baz"> <id name="code" type="string"> <column name="baz_id" length="32"/> Index: Blobber.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Blobber.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Blobber.hbm.xml 29 Mar 2003 04:08:49 -0000 1.2 --- Blobber.hbm.xml 29 Mar 2003 07:36:22 -0000 1.3 *************** *** 2,6 **** <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> ! <class name="net.sf.hibernate.test.Blobber" import="Blobber" dynamic-update="true"> <id name="id"> <generator class="hilo"/> --- 2,6 ---- <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> ! <class name="net.sf.hibernate.test.Blobber" dynamic-update="true"> <id name="id"> <generator class="hilo"/> Index: Blobber.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Blobber.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Blobber.java 15 Feb 2003 01:00:56 -0000 1.1 --- Blobber.java 29 Mar 2003 07:36:22 -0000 1.2 *************** *** 4,15 **** import java.sql.Clob; - /** - * @author Administrator - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ public class Blobber { private int id; --- 4,7 ---- Index: Category.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Category.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Category.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 --- Category.hbm.xml 29 Mar 2003 07:36:22 -0000 1.4 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Category" import="Category" table="category"> <id name="id" unsaved-value="0"> <generator class="native"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Category" table="category"> <id name="id" unsaved-value="0"> <generator class="native"/> Index: Circular.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Circular.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Circular.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 --- Circular.hbm.xml 29 Mar 2003 07:36:22 -0000 1.4 *************** *** 3,7 **** <hibernate-mapping default-cascade="save-update"> ! <class name="net.sf.hibernate.test.Circular" import="Circular" > <id name="id" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> --- 3,7 ---- <hibernate-mapping default-cascade="save-update"> ! <class name="net.sf.hibernate.test.Circular"> <id name="id" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> Index: Container.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Container.hbm.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Container.hbm.xml 29 Mar 2003 04:08:49 -0000 1.6 --- Container.hbm.xml 29 Mar 2003 07:36:22 -0000 1.7 *************** *** 3,8 **** <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > ! <hibernate-mapping> ! <class name="net.sf.hibernate.test.Container" import="Container" proxy="net.sf.hibernate.test.Container"> <id name="id" column="container_id"> <generator class="native" /> --- 3,13 ---- <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > ! <hibernate-mapping auto-import="false"> ! ! <import class="net.sf.hibernate.test.Container" rename="ContainerX"/> ! <import class="net.sf.hibernate.test.Contained"/> ! <import class="java.lang.Object" rename="Universe"/> ! ! <class name="net.sf.hibernate.test.Container" proxy="net.sf.hibernate.test.Container"> <id name="id" column="container_id"> <generator class="native" /> *************** *** 74,78 **** </class> ! <class name="net.sf.hibernate.test.Contained" import="Contained" proxy="net.sf.hibernate.test.Contained"> <id name="id" column="container_id" unsaved-value="0"> <generator class="native" /> --- 79,83 ---- </class> ! <class name="net.sf.hibernate.test.Contained" proxy="net.sf.hibernate.test.Contained"> <id name="id" column="container_id" unsaved-value="0"> <generator class="native" /> Index: Custom.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Custom.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Custom.hbm.xml 29 Mar 2003 04:08:49 -0000 1.4 --- Custom.hbm.xml 29 Mar 2003 07:36:22 -0000 1.5 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Custom" import="Custom" persister="net.sf.hibernate.test.CustomPersister"> <id type="string" name="key" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Custom" persister="net.sf.hibernate.test.CustomPersister"> <id type="string" name="key" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> Index: Fee.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Fee.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Fee.hbm.xml 29 Mar 2003 04:08:49 -0000 1.5 --- Fee.hbm.xml 29 Mar 2003 07:36:22 -0000 1.6 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fee" import="Fee" > <id type="string" name="key" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fee"> <id type="string" name="key" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> Index: Fo.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Fo.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Fo.hbm.xml 29 Mar 2003 04:08:49 -0000 1.4 --- Fo.hbm.xml 29 Mar 2003 07:36:22 -0000 1.5 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fo" import="Fo" table="foes"> <composite-id class="net.sf.hibernate.test.FumCompositeID"> <key-property name="string"> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fo" table="foes"> <composite-id class="net.sf.hibernate.test.FumCompositeID"> <key-property name="string"> Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBar.hbm.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FooBar.hbm.xml 29 Mar 2003 04:08:49 -0000 1.10 --- FooBar.hbm.xml 29 Mar 2003 07:36:22 -0000 1.11 *************** *** 11,16 **** proxy="net.sf.hibernate.test.FooProxy" discriminator-value="F" ! dynamic-update="true" ! import="Foo"> <jcs-cache usage="read-write"/> --- 11,15 ---- proxy="net.sf.hibernate.test.FooProxy" discriminator-value="F" ! dynamic-update="true"> <jcs-cache usage="read-write"/> *************** *** 112,117 **** name="net.sf.hibernate.test.Bar" proxy="net.sf.hibernate.test.BarProxy" ! discriminator-value="B" ! import="Bar" > <many-to-one name="baz"/> <property name="barString"> --- 111,115 ---- name="net.sf.hibernate.test.Bar" proxy="net.sf.hibernate.test.BarProxy" ! discriminator-value="B"> <many-to-one name="baz"/> <property name="barString"> Index: Fum.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Fum.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Fum.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 --- Fum.hbm.xml 29 Mar 2003 07:36:22 -0000 1.4 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fum" import="Fum"> <composite-id name="id" unsaved-value="any"> <key-property name="string"> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fum"> <composite-id name="id" unsaved-value="any"> <key-property name="string"> Index: Fumm.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Fumm.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Fumm.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 --- Fumm.hbm.xml 29 Mar 2003 07:36:22 -0000 1.4 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fumm" import="Fumm"> <composite-id name="id"> <key-property name="string"> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fumm"> <composite-id name="id"> <key-property name="string"> Index: Glarch.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Glarch.hbm.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Glarch.hbm.xml 29 Mar 2003 04:08:49 -0000 1.9 --- Glarch.hbm.xml 29 Mar 2003 07:36:22 -0000 1.10 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Glarch" table="glarchez" import="Glarch" proxy="net.sf.hibernate.test.GlarchProxy"> <!--<jcs-cache usage="read-write"/>--> <id type="string" column="tha_key" length="32"> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Glarch" table="glarchez" proxy="net.sf.hibernate.test.GlarchProxy"> <!--<jcs-cache usage="read-write"/>--> <id type="string" column="tha_key" length="32"> Index: Holder.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Holder.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Holder.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 --- Holder.hbm.xml 29 Mar 2003 07:36:22 -0000 1.4 *************** *** 2,6 **** <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> ! <class name="net.sf.hibernate.test.Holder" import="Holder"> <id name="id" column="id_" type="string" length="32" unsaved-value="null"> <generator class="uuid.hex"/> </id> <property name="name" unique="true" not-null="true" length="36"/> <list name="ones"> <key column="holder"/> <index column="i"/> <one-to-many class="net.sf.hibernate.test.One"/> </list> <array name="fooArray"> <key column="holder1"/> <index column="j1"/> <one-to-many class="net.sf.hibernate.test.Foo"/> </array> --- 2,6 ---- <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> ! <class name="net.sf.hibernate.test.Holder"> <id name="id" column="id_" type="string" length="32" unsaved-value="null"> <generator class="uuid.hex"/> </id> <property name="name" unique="true" not-null="true" length="36"/> <list name="ones"> <key column="holder"/> <index column="i"/> <one-to-many class="net.sf.hibernate.test.One"/> </list> <array name="fooArray"> <key column="holder1"/> <index column="j1"/> <one-to-many class="net.sf.hibernate.test.Foo"/> </array> Index: Immutable.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Immutable.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Immutable.hbm.xml 29 Mar 2003 04:08:49 -0000 1.4 --- Immutable.hbm.xml 29 Mar 2003 07:36:22 -0000 1.5 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Immutable" import="Immutable" table="immut" mutable="false"> <jcs-cache usage="read-only"/> <id name="id" column="id_" length="64"> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Immutable" table="immut" mutable="false"> <jcs-cache usage="read-only"/> <id name="id" column="id_" length="64"> Index: Location.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Location.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Location.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 --- Location.hbm.xml 29 Mar 2003 07:36:22 -0000 1.4 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Location" import="Location"> <composite-id> <key-property name="streetNumber"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Location"> <composite-id> <key-property name="streetNumber"/> Index: Many.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Many.hbm.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Many.hbm.xml 29 Mar 2003 04:08:49 -0000 1.6 --- Many.hbm.xml 29 Mar 2003 07:36:22 -0000 1.7 *************** *** 4,8 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Many" import="Many" table="many"> <id name="key" column="many_key" unsaved-value="0"> <generator class="native" /> --- 4,8 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Many" table="many"> <id name="key" column="many_key" unsaved-value="0"> <generator class="native" /> Index: MasterDetail.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/MasterDetail.hbm.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MasterDetail.hbm.xml 29 Mar 2003 04:08:49 -0000 1.6 --- MasterDetail.hbm.xml 29 Mar 2003 07:36:22 -0000 1.7 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Master" import="Master"> <id column="master_key" type="long"> <generator class="native"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Master"> <id column="master_key" type="long"> <generator class="native"/> *************** *** 32,36 **** </class> ! <class name="net.sf.hibernate.test.Detail" import="Detail"> <id column="detail_key" type="long"> <generator class="native"/> --- 32,36 ---- </class> ! <class name="net.sf.hibernate.test.Detail"> <id column="detail_key" type="long"> <generator class="native"/> *************** *** 46,50 **** </class> ! <class name="net.sf.hibernate.test.SubDetail" import="SubDetail"> <id column="subdetail_key" type="long"> <generator class="native"> --- 46,50 ---- </class> ! <class name="net.sf.hibernate.test.SubDetail"> <id column="subdetail_key" type="long"> <generator class="native"> Index: Multi.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Multi.hbm.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Multi.hbm.xml 29 Mar 2003 04:08:49 -0000 1.7 --- Multi.hbm.xml 29 Mar 2003 07:36:22 -0000 1.8 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Simple" table="rootclass" import="Simple" dynamic-update="true"> <jcs-cache usage="read-write"/> <id type="long" column="id_" > --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Simple" table="rootclass" dynamic-update="true"> <jcs-cache usage="read-write"/> <id type="long" column="id_" > *************** *** 13,17 **** <property name="date" column="date_"/> ! <joined-subclass name="net.sf.hibernate.test.Mono" import="Mono" table="mono"> <key column="superid"/> <set name="strings" table="monostrings"> --- 13,17 ---- <property name="date" column="date_"/> ! <joined-subclass name="net.sf.hibernate.test.Mono" table="mono"> <key column="superid"/> <set name="strings" table="monostrings"> *************** *** 21,29 **** </joined-subclass> ! <joined-subclass name="net.sf.hibernate.test.TrivialClass" import="TrivialClass"> <key column="tcid"/> </joined-subclass> ! <joined-subclass name="net.sf.hibernate.test.LessSimple" import="LessSimple" table="leafsubclass"> <key column="id__"/> <property name="intprop" not-null="true"/> --- 21,29 ---- </joined-subclass> ! <joined-subclass name="net.sf.hibernate.test.TrivialClass"> <key column="tcid"/> </joined-subclass> ! <joined-subclass name="net.sf.hibernate.test.LessSimple" table="leafsubclass"> <key column="id__"/> <property name="intprop" not-null="true"/> *************** *** 43,47 **** </joined-subclass> ! <joined-subclass name="net.sf.hibernate.test.Multi" table="nonleafsubclass" import="Multi" dynamic-update="true"> <key column="sid"/> <property name="extraProp"/> --- 43,47 ---- </joined-subclass> ! <joined-subclass name="net.sf.hibernate.test.Multi" table="nonleafsubclass" dynamic-update="true"> <key column="sid"/> <property name="extraProp"/> *************** *** 54,58 **** </component> ! <joined-subclass name="net.sf.hibernate.test.SubMulti" import="SubMulti" table="leafsubsubclass"> <key column="sid"/> <property name="amount"/> --- 54,58 ---- </component> ! <joined-subclass name="net.sf.hibernate.test.SubMulti" table="leafsubsubclass"> <key column="sid"/> <property name="amount"/> *************** *** 68,72 **** </class> ! <class name="net.sf.hibernate.test.Po" import="Po"> <id type="long" column="id_"> <generator class="native"/> --- 68,72 ---- </class> ! <class name="net.sf.hibernate.test.Po"> <id type="long" column="id_"> <generator class="native"/> Index: Nameable.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Nameable.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Nameable.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 --- Nameable.hbm.xml 29 Mar 2003 07:36:22 -0000 1.4 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Nameable" import="Nameable"> <id name="key" column="key_"> <generator class="native"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Nameable"> <id name="key" column="key_"> <generator class="native"/> Index: One.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/One.hbm.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** One.hbm.xml 29 Mar 2003 04:08:49 -0000 1.6 --- One.hbm.xml 29 Mar 2003 07:36:22 -0000 1.7 *************** *** 4,8 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.One" import="One" table="one"> <id name="key" column="one_key" unsaved-value="0"> <generator class="native" /> --- 4,8 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.One" table="one"> <id name="key" column="one_key" unsaved-value="0"> <generator class="native" /> Index: ParentChild.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ParentChild.hbm.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ParentChild.hbm.xml 29 Mar 2003 04:08:49 -0000 1.6 --- ParentChild.hbm.xml 29 Mar 2003 07:36:22 -0000 1.7 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Parent" import="Parent"> <id name="id" type="long"> <generator class="native"> <!--seqhilo--> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Parent"> <id name="id" type="long"> <generator class="native"> <!--seqhilo--> *************** *** 18,22 **** </class> ! <class name="net.sf.hibernate.test.Child" import="Child"> <id name="id" type="long"> <generator class="assigned"/> --- 18,22 ---- </class> ! <class name="net.sf.hibernate.test.Child"> <id name="id" type="long"> <generator class="assigned"/> Index: ParentChildTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ParentChildTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ParentChildTest.java 23 Feb 2003 01:32:21 -0000 1.7 --- ParentChildTest.java 29 Mar 2003 07:36:22 -0000 1.8 *************** *** 47,97 **** s.save(c); assertTrue( ! s.find("select c from c in class Container, s in class Simple where c.oneToMany[2] = s") .size() == 1 ); assertTrue( ! s.find("select c from c in class Container, s in class Simple where c.manyToMany[2] = s") .size() == 1 ); assertTrue( ! s.find("select c from c in class Container, s in class Simple where s = c.oneToMany[2]") .size() == 1 ); assertTrue( ! s.find("select c from c in class Container, s in class Simple where s = c.manyToMany[2]") .size() == 1 ); assertTrue( ! s.find("select c from c in class Container where c.oneToMany[0].name = 's'") .size() == 1 ); assertTrue( ! s.find("select c from c in class Container where c.manyToMany[0].name = 's'") .size() == 1 ); assertTrue( ! s.find("select c from c in class Container where 's' = c.oneToMany[2 - 2].name") .size() == 1 ); assertTrue( ! s.find("select c from c in class Container where 's' = c.manyToMany[(3+1)/4-1].name") .size() == 1 ); if ( ! ( dialect instanceof MySQLDialect ) ) { assertTrue( ! s.find("select c from c in class Container where c.manyToMany[ c.manyToMany.maxIndex ].count = 2") .size() == 1 ); assertTrue( ! s.find("select c from c in class Container where c.manyToMany[ maxindex(c.manyToMany) ].count = 2") .size() == 1 ); } assertTrue( ! s.find("select c from c in class Container where c.oneToMany[ c.manyToMany[0].count ].name = 's'") .size() == 1 ); assertTrue( ! s.find("select c from c in class Container where c.manyToMany[ c.oneToMany[0].count ].name = 's'") .size() == 1 ); --- 47,97 ---- s.save(c); assertTrue( ! s.find("select c from c in class ContainerX, s in class Simple where c.oneToMany[2] = s") .size() == 1 ); assertTrue( ! s.find("select c from c in class ContainerX, s in class Simple where c.manyToMany[2] = s") .size() == 1 ); assertTrue( ! s.find("select c from c in class ContainerX, s in class Simple where s = c.oneToMany[2]") .size() == 1 ); assertTrue( ! s.find("select c from c in class ContainerX, s in class Simple where s = c.manyToMany[2]") .size() == 1 ); assertTrue( ! s.find("select c from c in class ContainerX where c.oneToMany[0].name = 's'") .size() == 1 ); assertTrue( ! s.find("select c from c in class ContainerX where c.manyToMany[0].name = 's'") .size() == 1 ); assertTrue( ! s.find("select c from c in class ContainerX where 's' = c.oneToMany[2 - 2].name") .size() == 1 ); assertTrue( ! s.find("select c from c in class ContainerX where 's' = c.manyToMany[(3+1)/4-1].name") .size() == 1 ); if ( ! ( dialect instanceof MySQLDialect ) ) { assertTrue( ! s.find("select c from c in class ContainerX where c.manyToMany[ c.manyToMany.maxIndex ].count = 2") .size() == 1 ); assertTrue( ! s.find("select c from c in class ContainerX where c.manyToMany[ maxindex(c.manyToMany) ].count = 2") .size() == 1 ); } assertTrue( ! s.find("select c from c in class ContainerX where c.oneToMany[ c.manyToMany[0].count ].name = 's'") .size() == 1 ); assertTrue( ! s.find("select c from c in class ContainerX where c.manyToMany[ c.oneToMany[0].count ].name = 's'") .size() == 1 ); *************** *** 215,219 **** c1 = (Contained) s.load( Contained.class, new Long(c1.getId()) ); assertTrue( c1.getBag().size()==0 ); ! s.delete("from c in class Container"); s.delete("from c in class Contained"); s.delete("from s in class Simple"); --- 215,219 ---- c1 = (Contained) s.load( Contained.class, new Long(c1.getId()) ); assertTrue( c1.getBag().size()==0 ); ! s.delete("from c in class ContainerX"); s.delete("from c in class Contained"); s.delete("from s in class Simple"); *************** *** 361,365 **** s.close(); s=sessions.openSession(); ! c = (Container) s.iterate("from c in class Container").next(); cic = (Container.ContainerInnerClass) c.getCascades().iterator().next(); assertTrue( cic.getMany()!=null && cic.getOne()!=null ); --- 361,365 ---- s.close(); s=sessions.openSession(); ! c = (Container) s.iterate("from c in class ContainerX").next(); cic = (Container.ContainerInnerClass) c.getCascades().iterator().next(); assertTrue( cic.getMany()!=null && cic.getOne()!=null ); *************** *** 383,387 **** s.close(); s=sessions.openSession(); ! c = (Container) s.iterate("from c in class Container").next(); cic = (Container.ContainerInnerClass) c.getCascades().iterator().next(); assertTrue( cic.getMany()!=null && cic.getOne()!=null ); --- 383,387 ---- s.close(); s=sessions.openSession(); ! c = (Container) s.iterate("from c in class ContainerX").next(); cic = (Container.ContainerInnerClass) c.getCascades().iterator().next(); assertTrue( cic.getMany()!=null && cic.getOne()!=null ); *************** *** 414,418 **** s = sessions.openSession(); t = s.beginTransaction(); ! c = (Container) s.find("from c in class Container").get(0); Contained c3 = new Contained(); //c.getBag().add(c3); --- 414,418 ---- s = sessions.openSession(); t = s.beginTransaction(); ! c = (Container) s.find("from c in class ContainerX").get(0); Contained c3 = new Contained(); //c.getBag().add(c3); *************** *** 425,429 **** s = sessions.openSession(); t = s.beginTransaction(); ! c = (Container) s.find("from c in class Container").get(0); Contained c4 = new Contained(); c.getLazyBag().add(c4); --- 425,429 ---- s = sessions.openSession(); t = s.beginTransaction(); ! c = (Container) s.find("from c in class ContainerX").get(0); Contained c4 = new Contained(); c.getLazyBag().add(c4); *************** *** 436,440 **** s = sessions.openSession(); t = s.beginTransaction(); ! c = (Container) s.find("from c in class Container").get(0); Iterator i = c.getBag().iterator(); int j=0; --- 436,440 ---- s = sessions.openSession(); t = s.beginTransaction(); ! c = (Container) s.find("from c in class ContainerX").get(0); Iterator i = c.getBag().iterator(); int j=0; *************** *** 498,502 **** assertTrue( c.getOther().getOther().getOther()==c); assertTrue( c.getAnyEntity()==c.getOther() ); ! assertTrue( s.delete("from o in class java.lang.Object")==3 ); tx.commit(); s.close(); --- 498,502 ---- assertTrue( c.getOther().getOther().getOther()==c); assertTrue( c.getAnyEntity()==c.getOther() ); ! assertTrue( s.delete("from o in class Universe")==3 ); tx.commit(); s.close(); *************** *** 506,510 **** Session s = sessions.openSession(); assertTrue( s.delete("from s in class Simple")==0 ); ! assertTrue( s.delete("from o in class java.lang.Object")==0 ); s.close(); } --- 506,510 ---- Session s = sessions.openSession(); assertTrue( s.delete("from s in class Simple")==0 ); ! assertTrue( s.delete("from o in class Universe")==0 ); s.close(); } Index: Qux.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Qux.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Qux.hbm.xml 29 Mar 2003 04:08:49 -0000 1.5 --- Qux.hbm.xml 29 Mar 2003 07:36:22 -0000 1.6 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Qux" table="quux" import="Qux" proxy="net.sf.hibernate.test.Qux"> <!----> <id name="key" column="qux_key" unsaved-value="0"> <generator class="hilo"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Qux" table="quux" proxy="net.sf.hibernate.test.Qux"> <!----> <id name="key" column="qux_key" unsaved-value="0"> <generator class="hilo"/> Index: Simple.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Simple.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Simple.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 --- Simple.hbm.xml 29 Mar 2003 07:36:22 -0000 1.4 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Simple" import="Simple"> <id type="long" column="id_"> <generator class="assigned"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Simple"> <id type="long" column="id_"> <generator class="assigned"/> Index: SingleSeveral.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/SingleSeveral.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SingleSeveral.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 --- SingleSeveral.hbm.xml 29 Mar 2003 07:36:22 -0000 1.4 *************** *** 5,9 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Single" import="Single"> <composite-id> <key-property name="id" length="32"/> --- 5,9 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Single"> <composite-id> <key-property name="id" length="32"/> *************** *** 20,24 **** </class> ! <class name="net.sf.hibernate.test.Several" import="Several"> <composite-id> <key-property name="id" length="32"/> --- 20,24 ---- </class> ! <class name="net.sf.hibernate.test.Several"> <composite-id> <key-property name="id" length="32"/> Index: Stuff.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Stuff.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Stuff.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 --- Stuff.hbm.xml 29 Mar 2003 07:36:22 -0000 1.4 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.MoreStuff" import="MoreStuff"> <composite-id> <key-property name="intId"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.MoreStuff"> <composite-id> <key-property name="intId"/> *************** *** 19,23 **** </class> ! <class name="net.sf.hibernate.test.Stuff" import="Stuff"> <composite-id> <key-property name="id"/> --- 19,23 ---- </class> ! <class name="net.sf.hibernate.test.Stuff"> <composite-id> <key-property name="id"/> Index: Vetoer.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Vetoer.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Vetoer.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 --- Vetoer.hbm.xml 29 Mar 2003 07:36:22 -0000 1.4 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Vetoer" import="Vetoer"> <id type="string" column="id_" length="32"> <generator class="uuid.hex"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Vetoer"> <id type="string" column="id_" length="32"> <generator class="uuid.hex"/> |
From: <one...@us...> - 2003-03-29 07:36:28
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util In directory sc8-pr-cvs1:/tmp/cvs-serv3374/hibernate/util Modified Files: ReflectHelper.java Log Message: re-reworked import functionality Index: ReflectHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/ReflectHelper.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ReflectHelper.java 26 Feb 2003 13:27:25 -0000 1.8 --- ReflectHelper.java 29 Mar 2003 07:36:23 -0000 1.9 *************** *** 9,12 **** --- 9,16 ---- import java.lang.reflect.Modifier; + import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; + + import net.sf.cglib.MetaClass; import net.sf.hibernate.AssertionFailure; import net.sf.hibernate.HibernateException; *************** *** 20,23 **** --- 24,29 ---- public final class ReflectHelper { + private static final Log log = LogFactory.getLog(ReflectHelper.class); + private static final Class[] NO_CLASSES = new Class[0]; private static final Class[] OBJECT = new Class[] { Object.class }; *************** *** 55,58 **** --- 61,66 ---- } catch (IllegalArgumentException iae) { + log.error("IllegalArgumentException in class: " + clazz.getName() + ", setter method: " + method + ", propertyName: " + propertyName); + log.error("target: " + target + " value: " + value); throw new PropertyAccessException(iae, "IllegalArgumentException occurred while calling", true, clazz, propertyName); } *************** *** 88,91 **** --- 96,101 ---- } catch (IllegalArgumentException iae) { + log.error("IllegalArgumentException in class: " + clazz.getName() + ", getter method: " + method + ", propertyName: " + propertyName); + log.error("target: " + target); throw new PropertyAccessException(iae, "IllegalArgumentException occurred calling", false, clazz, propertyName); } *************** *** 290,293 **** --- 300,324 ---- int modifier = clazz.getModifiers(); return (Modifier.isAbstract(modifier) || Modifier.isInterface(modifier)); + } + + public static MetaClass getMetaClass(Class clazz, String[] getterNames, String[] setterNames, Class[] types) { + try { + MetaClass optimizer = MetaClass.getInstance( clazz.getClassLoader(), clazz, getterNames, setterNames, types ); + //test out the optimizer: + optimizer.setPropertyValues( optimizer.newInstance(), optimizer.getPropertyValues( optimizer.newInstance() ) ); + //if working: + return optimizer; + } + catch (Throwable t) { + log.info( + "reflection optimizer disabled for: " + + clazz.getName() + + ", " + + StringHelper.unqualify( t.getClass().getName() ) + + ": " + + t.getMessage() + ); + return null; + } } |
From: <one...@us...> - 2003-03-29 07:36:28
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv3374/hibernate/type Modified Files: ComponentType.java Log Message: re-reworked import functionality Index: ComponentType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type/ComponentType.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ComponentType.java 29 Mar 2003 04:08:49 -0000 1.9 --- ComponentType.java 29 Mar 2003 07:36:23 -0000 1.10 *************** *** 93,107 **** this.joinedFetch = joinedFetch; constructor = ReflectHelper.getDefaultConstructor(componentClass); ! ! MetaClass opt; ! try { ! opt = MetaClass.getInstance(componentClass.getClassLoader(), componentClass, getterNames, setterNames, propTypes); ! opt.setPropertyValues( opt.newInstance(), opt.getPropertyValues( opt.newInstance() ) ); ! } ! catch (Throwable t) { ! opt=null; ! log.info( "reflection optimizer disabled for: " + componentClass.getName() ); ! } ! optimizer=opt; } --- 93,97 ---- this.joinedFetch = joinedFetch; constructor = ReflectHelper.getDefaultConstructor(componentClass); ! optimizer = ReflectHelper.getMetaClass(componentClass, getterNames, setterNames, propTypes); } |
From: <one...@us...> - 2003-03-29 07:36:25
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv3374/hibernate/persister Modified Files: AbstractEntityPersister.java Log Message: re-reworked import functionality Index: AbstractEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/AbstractEntityPersister.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** AbstractEntityPersister.java 29 Mar 2003 04:08:48 -0000 1.15 --- AbstractEntityPersister.java 29 Mar 2003 07:36:22 -0000 1.16 *************** *** 321,337 **** else { if (abstractClass) throw new HibernateException("Cannot instantiate abstract class or interface: " + className); ! try { ! if (optimizer != null) { ! try { ! return optimizer.newInstance(); ! } ! catch (Throwable t) { ! throw new InstantiationException("Could not instantiate entity with CGLIB: ", mappedClass, t); ! } } - return constructor.newInstance(null); } ! catch (Exception e) { ! throw new InstantiationException("Could not instantiate entity: ", mappedClass, e); } } --- 321,339 ---- else { if (abstractClass) throw new HibernateException("Cannot instantiate abstract class or interface: " + className); ! if (optimizer != null) { ! try { ! return optimizer.newInstance(); ! } ! catch (Throwable t) { ! throw new InstantiationException("Could not instantiate entity with CGLIB: ", mappedClass, t); } } ! else { ! try { ! return constructor.newInstance(null); ! } ! catch (Exception e) { ! throw new InstantiationException("Could not instantiate entity: ", mappedClass, e); ! } } } *************** *** 674,688 **** } ! MetaClass opt; ! try { ! opt = MetaClass.getInstance( mappedClass.getClassLoader(), mappedClass, getterNames, setterNames, types ); ! opt.setPropertyValues( opt.newInstance(), opt.getPropertyValues( opt.newInstance() ) ); ! //throw new NullPointerException(); ! } ! catch(Throwable t) { ! opt=null; ! log.info("reflection optimizer disabled for: " + mappedClass); ! } ! optimizer=opt; hasCascades = foundCascade; --- 676,680 ---- } ! optimizer=ReflectHelper.getMetaClass(mappedClass, getterNames, setterNames, types); hasCascades = foundCascade; |
From: <one...@us...> - 2003-03-29 07:36:25
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv3374/hibernate Modified Files: hibernate-mapping-2.0.dtd Log Message: re-reworked import functionality Index: hibernate-mapping-2.0.dtd =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hibernate-mapping-2.0.dtd,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** hibernate-mapping-2.0.dtd 29 Mar 2003 04:08:46 -0000 1.17 --- hibernate-mapping-2.0.dtd 29 Mar 2003 07:36:22 -0000 1.18 *************** *** 22,27 **** <!ATTLIST hibernate-mapping schema CDATA #IMPLIED> <!-- default: none --> <!ATTLIST hibernate-mapping default-cascade (none|save-update|all) "none"> ! ! <!-- A query language "import" --> <!ELEMENT import EMPTY> --- 22,28 ---- <!ATTLIST hibernate-mapping schema CDATA #IMPLIED> <!-- default: none --> <!ATTLIST hibernate-mapping default-cascade (none|save-update|all) "none"> ! <!ATTLIST hibernate-mapping auto-import (true|false) "true"> ! ! <!-- An explicit query language "import" --> <!ELEMENT import EMPTY> *************** *** 49,53 **** <!ATTLIST class persister CDATA #IMPLIED> <!ATTLIST class dynamic-update (true|false) "false"> - <!ATTLIST class import CDATA #IMPLIED> <!-- Declares the id type, column and generation algorithm for an entity class. --- 50,53 ---- |
From: <one...@us...> - 2003-03-29 07:36:25
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg In directory sc8-pr-cvs1:/tmp/cvs-serv3374/hibernate/cfg Modified Files: Binder.java Mappings.java Log Message: re-reworked import functionality Index: Binder.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Binder.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Binder.java 29 Mar 2003 04:08:46 -0000 1.10 --- Binder.java 29 Mar 2003 07:36:22 -0000 1.11 *************** *** 92,98 **** ); //IMPORT ! Attribute importNode = node.attribute("import"); ! if (importNode!=null) { ! mapping.addImport( className, importNode.getValue() ); } } --- 92,97 ---- ); //IMPORT ! if ( mapping.isAutoImport() ) { ! mapping.addImport( className, StringHelper.unqualify(className) ); } } *************** *** 936,940 **** model.setSchemaName( (schemaNode==null) ? null : schemaNode.getValue() ); Attribute dcNode = hmNode.attribute("default-cascade"); ! model.setDefaultCascade( (dcNode==null) ? "none" : dcNode.getValue() ); Iterator nodes = hmNode.elementIterator("class"); --- 935,940 ---- model.setSchemaName( (schemaNode==null) ? null : schemaNode.getValue() ); Attribute dcNode = hmNode.attribute("default-cascade"); ! model.setDefaultCascade( (dcNode==null) ? "none" : dcNode.getValue() ); ! model.setAutoImport( "true".equals( hmNode.attributeValue("auto-import") ) ); Iterator nodes = hmNode.elementIterator("class"); Index: Mappings.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Mappings.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Mappings.java 29 Mar 2003 04:08:46 -0000 1.5 --- Mappings.java 29 Mar 2003 07:36:22 -0000 1.6 *************** *** 30,33 **** --- 30,34 ---- private String schemaName; private String defaultCascade; + private boolean autoImport; Mappings(Map classes, Map collections, Map tables, Map queries, Map imports, List secondPasses) { *************** *** 114,117 **** --- 115,134 ---- void addSecondPass(Binder.SecondPass sp) { secondPasses.add(sp); + } + + /** + * Returns the autoImport. + * @return boolean + */ + public boolean isAutoImport() { + return autoImport; + } + + /** + * Sets the autoImport. + * @param autoImport The autoImport to set + */ + public void setAutoImport(boolean autoImport) { + this.autoImport = autoImport; } |
From: <one...@us...> - 2003-03-29 04:22:51
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv7302/reference/src Modified Files: persistent_classes.xml Log Message: changed id type in example to Long Index: persistent_classes.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/persistent_classes.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** persistent_classes.xml 23 Feb 2003 13:53:24 -0000 1.2 --- persistent_classes.xml 29 Mar 2003 04:22:48 -0000 1.3 *************** *** 15,19 **** public class Cat { ! private long id; // identifier private Date birthdate; private Cat mate; --- 15,19 ---- public class Cat { ! private Long id; // identifier private Date birthdate; private Cat mate; *************** *** 23,30 **** private float weight; ! private void setId(long id) { this.id=id; } ! public long getId() { return id; } --- 23,30 ---- private float weight; ! private void setId(Long id) { this.id=id; } ! public Long getId() { return id; } |
From: <one...@us...> - 2003-03-29 04:20:27
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id In directory sc8-pr-cvs1:/tmp/cvs-serv6518/id Modified Files: IdentifierGeneratorFactory.java Added Files: ForeignGenerator.java Log Message: added foreign id generator for 1-to-1 associations --- NEW FILE: ForeignGenerator.java --- package net.sf.hibernate.id; import java.io.Serializable; import java.sql.SQLException; import java.util.Properties; import net.sf.hibernate.HibernateException; import net.sf.hibernate.MappingException; import net.sf.hibernate.dialect.Dialect; import net.sf.hibernate.engine.SessionImplementor; import net.sf.hibernate.type.Type; /** * <b>foreign</b><br> * <br> * An <tt>Identifier</tt> generator that uses the value of the id property of an * associated object * <br> * One mapping parameter id supported: property. */ public class ForeignGenerator implements IdentifierGenerator, Configurable { private String propertyName; /** * @see net.sf.hibernate.id.IdentifierGenerator#generate(net.sf.hibernate.engine.SessionImplementor, java.lang.Object) */ public Serializable generate(SessionImplementor session, Object object) throws SQLException, HibernateException { Object associatedObject = session.getFactory() .getClassMetadata( object.getClass() ) .getPropertyValue(object, propertyName); return session.getEntityIdentifierIfNotUnsaved(associatedObject); } /** * @see net.sf.hibernate.id.Configurable#configure(net.sf.hibernate.type.Type, java.util.Properties, net.sf.hibernate.dialect.Dialect) */ public void configure(Type type, Properties params, Dialect d) throws MappingException { propertyName = params.getProperty("property"); } } Index: IdentifierGeneratorFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/IdentifierGeneratorFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IdentifierGeneratorFactory.java 29 Mar 2003 04:08:47 -0000 1.2 --- IdentifierGeneratorFactory.java 29 Mar 2003 04:20:18 -0000 1.3 *************** *** 43,47 **** idgenerators.put("seqhilo", SequenceHiLoGenerator.class); idgenerators.put("vm", CounterGenerator.class); ! idgenerators.put("onetoone", OneToOneGenerator.class); } --- 43,47 ---- idgenerators.put("seqhilo", SequenceHiLoGenerator.class); idgenerators.put("vm", CounterGenerator.class); ! idgenerators.put("foreign", ForeignGenerator.class); } |
From: <one...@us...> - 2003-03-29 04:20:25
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv6518/test Added Files: X.java XY.hbm.xml Y.java Log Message: added foreign id generator for 1-to-1 associations --- NEW FILE: X.java --- package net.sf.hibernate.test; public class X { private long id; private Y y; /** * Returns the id. * @return long */ public long getId() { return id; } /** * Returns the y. * @return Y */ public Y getY() { return y; } /** * Sets the id. * @param id The id to set */ public void setId(long id) { this.id = id; } /** * Sets the y. * @param y The y to set */ public void setY(Y y) { this.y = y; } } --- NEW FILE: XY.hbm.xml --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="net.sf.hibernate.test.X"> <id name="id"> <generator class="foreign"> <param name="property">y</param> </generator> </id> <one-to-one name="y" constrained="true"/> </class> <class name="net.sf.hibernate.test.Y"> <id name="id"> <generator class="hilo"/> </id> <property name="x"/> </class> </hibernate-mapping> --- NEW FILE: Y.java --- package net.sf.hibernate.test; public class Y { private Long id; private String x; /** * Returns the id. * @return Long */ public Long getId() { return id; } /** * Returns the x. * @return String */ public String getX() { return x; } /** * Sets the id. * @param id The id to set */ public void setId(Long id) { this.id = id; } /** * Sets the x. * @param x The x to set */ public void setX(String x) { this.x = x; } } |
From: <one...@us...> - 2003-03-29 04:15:17
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping In directory sc8-pr-cvs1:/tmp/cvs-serv4676/hibernate/mapping Added Files: Any.java Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings --- NEW FILE: Any.java --- package net.sf.hibernate.mapping; import net.sf.hibernate.type.ObjectType; import net.sf.hibernate.type.Type; public class Any extends Value { private Type identifierType; public boolean isAny() { return true; } /** * Constructor for Any. */ public Any(Table table) { super(table); } /** * Returns the identifierType. * @return Type */ public Type getIdentifierType() { return identifierType; } /** * Sets the identifierType. * @param identifierType The identifierType to set */ public void setIdentifierType(Type identifierType) { this.identifierType = identifierType; } public Type getType() { return new ObjectType(identifierType); } public void setType(Type type) { throw new UnsupportedOperationException("cannot set type of an Any"); } public void setTypeByReflection(Class propertyClass, String propertyName) {} } |
From: <one...@us...> - 2003-03-29 04:09:25
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate/jca Modified Files: JCASessionImpl.java Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: JCASessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca/JCASessionImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JCASessionImpl.java 13 Mar 2003 03:16:01 -0000 1.4 --- JCASessionImpl.java 29 Mar 2003 04:08:47 -0000 1.5 *************** *** 253,255 **** --- 253,259 ---- } + public boolean contains(Object object) { + return session.contains(object); + } + } |
From: <one...@us...> - 2003-03-29 04:09:25
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate/mapping Modified Files: Value.java Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: Value.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Value.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Value.java 27 Jan 2003 12:51:50 -0000 1.9 --- Value.java 29 Mar 2003 04:08:47 -0000 1.10 *************** *** 152,155 **** --- 152,159 ---- this.nullValue = nullValue; } + + public boolean isAny() { + return false; + } } |
From: <one...@us...> - 2003-03-29 04:09:23
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate/hql Modified Files: PathExpressionParser.java QueryTranslator.java Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: PathExpressionParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/PathExpressionParser.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PathExpressionParser.java 9 Mar 2003 04:04:07 -0000 1.14 --- PathExpressionParser.java 29 Mar 2003 04:08:47 -0000 1.15 *************** *** 111,115 **** } ! if ( propertyType.isComponentType() ) { if ( componentPath==null ) { componentPath = token; --- 111,115 ---- } ! if ( propertyType.isComponentType() || propertyType.isObjectType() ) { if ( componentPath==null ) { componentPath = token; Index: QueryTranslator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/QueryTranslator.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** QueryTranslator.java 20 Mar 2003 13:59:06 -0000 1.21 --- QueryTranslator.java 29 Mar 2003 04:08:47 -0000 1.22 *************** *** 264,280 **** Queryable getPersisterUsingImports(String className) { - String[] imports = factory.getImports(); try { ! return (Queryable) factory.getPersister(className); } ! catch (Exception e) { ! for ( int i=0; i<imports.length; i++ ) { ! try { ! return (Queryable) factory.getPersister(imports[i] + StringHelper.DOT + className); ! } ! catch (Exception ex) {} ! } } - return null; } --- 264,273 ---- Queryable getPersisterUsingImports(String className) { try { ! return (Queryable) factory.getPersister( factory.getImportedClassName(className) ); } ! catch (MappingException me) { ! return null; } } *************** *** 759,770 **** public static String[] concreteQueries(String query, SessionFactoryImplementor factory) { //TODO: this is one of the ugliest and most fragile pieces of code in Hibernate.... ! String[] tokens = StringHelper.split( ParserHelper.WHITESPACE + ",", query, true ); ArrayList placeholders = new ArrayList(); ArrayList replacements = new ArrayList(); int count=0; String last = null; int nextIndex = 0; String next = null; for ( int i=1; i<tokens.length; i++ ) { --- 752,772 ---- public static String[] concreteQueries(String query, SessionFactoryImplementor factory) { + + //scan the query string for class names appearing in the from clause and replace + //with all persistent implementors of the class/interface, returning multiple + //query strings (make sure we don't pick up a class in the select clause!) + //TODO: this is one of the ugliest and most fragile pieces of code in Hibernate.... ! ! String[] tokens = StringHelper.split( ParserHelper.WHITESPACE + "(),", query, true ); ! if (tokens.length==0) return new String[] { query }; // just especially for the trivial collection filter ArrayList placeholders = new ArrayList(); ArrayList replacements = new ArrayList(); + StringBuffer templateQuery = new StringBuffer(40); int count=0; String last = null; int nextIndex = 0; String next = null; + templateQuery.append( tokens[0] ); for ( int i=1; i<tokens.length; i++ ) { *************** *** 773,805 **** String token = tokens[i]; ! if ( ParserHelper.isWhitespace(token) || last==null ) continue; ! //scan for next non-whitespace token ! if (nextIndex<=i) { ! for ( nextIndex=i+1; nextIndex<tokens.length; nextIndex++ ) { ! next = tokens[nextIndex].toLowerCase(); ! if ( !ParserHelper.isWhitespace(next) ) break; } ! } ! ! //if ( Character.isUpperCase( token.charAt( token.lastIndexOf(".") + 1 ) ) ) { ! if ( ! ( beforeClassTokens.contains(last) && !notAfterClassTokens.contains(next) ) || ! "class".equals(last) ! ){ ! Class clazz= getImportedClass(token, factory); ! if (clazz!=null) { ! String[] implementors = factory.getImplementors(clazz); ! String placeholder = "$clazz" + count + "$"; ! query = StringHelper.replaceOnce(query, token, placeholder); ! if ( implementors!=null ) { ! placeholders.add(placeholder); ! replacements.add(implementors); } } } } ! String[] results = StringHelper.multiply( query, placeholders.iterator(), replacements.iterator() ); if (results.length==0) log.warn("no persistent classes found for query class: " + query); return results; --- 775,811 ---- String token = tokens[i]; ! if ( !ParserHelper.isWhitespace(token) || last==null ) { ! //scan for next non-whitespace token ! if (nextIndex<=i) { ! for ( nextIndex=i+1; nextIndex<tokens.length; nextIndex++ ) { ! next = tokens[nextIndex].toLowerCase(); ! if ( !ParserHelper.isWhitespace(next) ) break; ! } } ! ! //if ( Character.isUpperCase( token.charAt( token.lastIndexOf(".") + 1 ) ) ) { ! if ( ! ( beforeClassTokens.contains(last) && !notAfterClassTokens.contains(next) ) || ! "class".equals(last) ! ){ ! Class clazz= getImportedClass(token, factory); ! if (clazz!=null) { ! String[] implementors = factory.getImplementors(clazz); ! String placeholder = "$clazz" + count++ + "$"; ! if ( implementors!=null ) { ! placeholders.add(placeholder); ! replacements.add(implementors); ! } ! token = placeholder; // Note this!! } } + } + templateQuery.append(token); + } ! String[] results = StringHelper.multiply( templateQuery.toString(), placeholders.iterator(), replacements.iterator() ); if (results.length==0) log.warn("no persistent classes found for query class: " + query); return results; *************** *** 810,813 **** --- 816,820 ---- static { beforeClassTokens.add("from"); + //beforeClassTokens.add("new"); DEFINITELY DON'T HAVE THIS!! beforeClassTokens.add(","); notAfterClassTokens.add("in"); *************** *** 823,836 **** private static Class getImportedClass(String name, SessionFactoryImplementor factory) { try { ! return ReflectHelper.classForName(name); } catch (Throwable e) { - String[] imports = factory.getImports(); - for (int i=0; i<imports.length; i++) { - try { - return ReflectHelper.classForName( imports[i] + StringHelper.DOT + name ); - } - catch (Throwable t) {} - } return null; } --- 830,836 ---- private static Class getImportedClass(String name, SessionFactoryImplementor factory) { try { ! return ReflectHelper.classForName( factory.getImportedClassName(name) ); } catch (Throwable e) { return null; } |
From: <one...@us...> - 2003-03-29 04:09:23
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate/id Modified Files: IdentifierGeneratorFactory.java Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: IdentifierGeneratorFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/IdentifierGeneratorFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IdentifierGeneratorFactory.java 9 Jan 2003 12:24:50 -0000 1.1 --- IdentifierGeneratorFactory.java 29 Mar 2003 04:08:47 -0000 1.2 *************** *** 13,17 **** /** ! * */ public class IdentifierGeneratorFactory { --- 13,17 ---- /** ! * Factory methods for <tt>IdentifierGenerator</tt> framework */ public class IdentifierGeneratorFactory { *************** *** 43,46 **** --- 43,47 ---- idgenerators.put("seqhilo", SequenceHiLoGenerator.class); idgenerators.put("vm", CounterGenerator.class); + idgenerators.put("onetoone", OneToOneGenerator.class); } |
From: <one...@us...> - 2003-03-29 04:09:22
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate/impl Modified Files: SessionFactoryImpl.java SessionImpl.java Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: SessionFactoryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionFactoryImpl.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** SessionFactoryImpl.java 4 Mar 2003 10:53:46 -0000 1.14 --- SessionFactoryImpl.java 29 Mar 2003 04:08:47 -0000 1.15 *************** *** 93,96 **** --- 93,97 ---- private transient final Map collectionPersisters; private transient final Map namedQueries; + private transient final Map imports; private transient final ConnectionProvider connections; private transient final Properties properties; *************** *** 100,104 **** private transient final Templates templates; private transient final Map querySubstitutions; ! private transient final String[] queryImports; private transient final Dialect dialect; private transient final PreparedStatementCache statementCache; --- 101,105 ---- private transient final Templates templates; private transient final Map querySubstitutions; ! //private transient final String[] queryImports; private transient final Dialect dialect; private transient final PreparedStatementCache statementCache; *************** *** 270,275 **** log.info("Query language substitutions: " + querySubstitutions); ! queryImports = PropertiesHelper.toStringArray(Environment.QUERY_IMPORTS, " ,;:\n\t\r\f", properties); ! if ( queryImports.length!=0 ) log.info( "Query language imports: " + StringHelper.toString(queryImports) ); /*datastore.getNamedQueries().entrySet().iterator(); --- 271,276 ---- log.info("Query language substitutions: " + querySubstitutions); ! //queryImports = PropertiesHelper.toStringArray(Environment.QUERY_IMPORTS, " ,;:\n\t\r\f", properties); ! //if ( queryImports.length!=0 ) log.info( "Query language imports: " + StringHelper.toString(queryImports) ); /*datastore.getNamedQueries().entrySet().iterator(); *************** *** 280,284 **** // TODO: precompile queries }*/ ! namedQueries = cfg.getNamedQueries(); --- 281,286 ---- // TODO: precompile queries }*/ ! namedQueries = new HashMap( cfg.getNamedQueries() ); ! imports = new HashMap( cfg.getImports() ); *************** *** 673,678 **** } ! public String[] getImports() { return queryImports; } --- 675,684 ---- } ! /*public String[] getImports() { return queryImports; + }*/ + public String getImportedClassName(String name) { + String result = (String) imports.get(name); + return (result==null) ? name : result; } Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** SessionImpl.java 21 Mar 2003 12:03:37 -0000 1.28 --- SessionImpl.java 29 Mar 2003 04:08:47 -0000 1.29 *************** *** 562,566 **** if (obj==null) throw new NullPointerException("attempted to save null"); ! Object object = HibernateProxyHelper.unproxy(obj, this); EntityEntry e = getEntry(object); --- 562,568 ---- if (obj==null) throw new NullPointerException("attempted to save null"); ! if ( !Hibernate.isInitialized(obj) ) throw new PersistentObjectException("uninitialized proxy passed to save()"); ! ! Object object = unproxyAndReassociate(obj); EntityEntry e = getEntry(object); *************** *** 582,586 **** throw new JDBCException("Could not save object", sqle); } ! return doSave(object, obj, id); } --- 584,588 ---- throw new JDBCException("Could not save object", sqle); } ! return doSave(object, id); } *************** *** 594,598 **** if (id==null) throw new NullPointerException("null identifier passed to insert()"); ! Object object = HibernateProxyHelper.unproxy(obj, this); EntityEntry e = getEntry(object); --- 596,602 ---- if (id==null) throw new NullPointerException("null identifier passed to insert()"); ! if ( !Hibernate.isInitialized(obj) ) throw new PersistentObjectException("uninitialized proxy passed to save()"); ! ! Object object = unproxyAndReassociate(obj); EntityEntry e = getEntry(object); *************** *** 610,617 **** } ! doSave(object, obj, id); } ! private Serializable doSave(Object object, Object proxy, Serializable id) throws HibernateException { ClassPersister persister = getPersister(object); --- 614,621 ---- } ! doSave(object, id); } ! private Serializable doSave(Object object, Serializable id) throws HibernateException { ClassPersister persister = getPersister(object); *************** *** 663,667 **** // same object again. QUESTION: should this be done before onSave() is called? // likewise, should it be done before onUpdate()? ! addEntry(object, SAVING, null, id, null, LockMode.WRITE, identityCol, persister); // cascade-save to many-to-one BEFORE the parent is saved --- 667,671 ---- // same object again. QUESTION: should this be done before onSave() is called? // likewise, should it be done before onUpdate()? ! addEntry(object, SAVING, null, id, null, LockMode.WRITE, identityCol, persister); //okay if id is null here (identityCol true) // cascade-save to many-to-one BEFORE the parent is saved *************** *** 708,712 **** addEntry(object, LOADED, values, id, Versioning.getVersion(values, persister), LockMode.WRITE, identityCol, persister); //tableAccesses.add( persister.getQualifiedTableName() ); - if (proxy!=object) proxiesByKey.put(key, proxy); if (!identityCol) insertions.add( new ScheduledInsertion( id, values, object, persister, this ) ); --- 712,715 ---- *************** *** 725,728 **** --- 728,758 ---- } + private void reassociateProxy(Object value) throws MappingException { + HibernateProxy proxy = (HibernateProxy) value; + LazyInitializer li = HibernateProxyHelper.getLazyInitializer(proxy); + reassociateProxy(li, proxy); + } + + private Object unproxyAndReassociate(Object maybeProxy) throws HibernateException { + if ( maybeProxy instanceof HibernateProxy ) { + HibernateProxy proxy = (HibernateProxy) maybeProxy; + LazyInitializer li = HibernateProxyHelper.getLazyInitializer(proxy); + reassociateProxy(li, proxy); + return li.getImplementation(); //initialize + unwrap the object + } + else { + return maybeProxy; + } + } + + private void reassociateProxy(LazyInitializer li, HibernateProxy proxy) throws MappingException { + if ( li.getSession()!=this ) { + ClassPersister persister = getPersister( li.getPersistentClass() ); + Key key = new Key( li.getIdentifier(), persister ); + if ( !proxiesByKey.containsKey(key) ) proxiesByKey.put(key, proxy); // any earlier proxy takes precedence + HibernateProxyHelper.getLazyInitializer( (HibernateProxy) proxy ).setSession(this); + } + } + private void nullifyTransientReferences(Object[] values, Type[] types, boolean earlyInsert, Object self) throws HibernateException { for ( int i=0; i<types.length; i++ ) { *************** *** 826,830 **** if (object==null) throw new NullPointerException("attempted to delete null"); ! object = HibernateProxyHelper.unproxy(object, this); EntityEntry entry = getEntry(object); --- 856,860 ---- if (object==null) throw new NullPointerException("attempted to delete null"); ! object = unproxyAndReassociate(object); EntityEntry entry = getEntry(object); *************** *** 1021,1027 **** if ( value!=null ) { ClassPersister persister = getPersister( ( (EntityType) type ).getPersistentClass() ); ! if ( persister.hasProxy() && (value instanceof HibernateProxy) ) { ! HibernateProxyHelper.getLazyInitializer( (HibernateProxy) value ).setSession(this); ! } } } --- 1051,1055 ---- if ( value!=null ) { ClassPersister persister = getPersister( ( (EntityType) type ).getPersistentClass() ); ! if ( persister.hasProxy() && !Hibernate.isInitialized(value) ) reassociateProxy(value); } } *************** *** 1040,1046 **** if (obj==null) throw new NullPointerException("attempted to update null"); - if ( !Hibernate.isInitialized(obj) ) return; ! Object object = HibernateProxyHelper.unproxy(obj, this); ClassPersister persister = getPersister(object); --- 1068,1078 ---- if (obj==null) throw new NullPointerException("attempted to update null"); ! if ( !Hibernate.isInitialized(obj) ) { ! reassociateProxy(obj); ! return; ! } ! ! Object object = unproxyAndReassociate(obj); ClassPersister persister = getPersister(object); *************** *** 1062,1066 **** } else { ! doUpdate(object, obj, id); } --- 1094,1098 ---- } else { ! doUpdate(object, id); } *************** *** 1076,1081 **** public void saveOrUpdate(Object obj) throws HibernateException { if (obj==null) throw new NullPointerException("attempted to update null"); ! if ( !Hibernate.isInitialized(obj) ) return; ! Object object = HibernateProxyHelper.unproxy(obj, this); EntityEntry e = getEntry(object); --- 1108,1117 ---- public void saveOrUpdate(Object obj) throws HibernateException { if (obj==null) throw new NullPointerException("attempted to update null"); ! ! if ( !Hibernate.isInitialized(obj) ) { ! reassociateProxy(obj); ! return; ! } ! Object object = unproxyAndReassociate(obj); EntityEntry e = getEntry(object); *************** *** 1105,1109 **** else { if ( log.isTraceEnabled() ) log.trace("saveOrUpdate() previously saved instance with id: " + id); ! doUpdate(object, obj, id); } --- 1141,1145 ---- else { if ( log.isTraceEnabled() ) log.trace("saveOrUpdate() previously saved instance with id: " + id); ! doUpdate(object, id); } *************** *** 1134,1144 **** if (id==null) throw new NullPointerException("null is not a valid identifier"); if (obj==null) throw new NullPointerException("attempted to update null"); - if ( !Hibernate.isInitialized(obj) ) return; ! Object object = HibernateProxyHelper.unproxy(obj, this); EntityEntry e = getEntry(object); if (e==null) { ! doUpdate(object, obj, id); } else { --- 1170,1192 ---- if (id==null) throw new NullPointerException("null is not a valid identifier"); if (obj==null) throw new NullPointerException("attempted to update null"); ! if ( obj instanceof HibernateProxy ) { ! Serializable pid = HibernateProxyHelper.getLazyInitializer( (HibernateProxy) obj ).getIdentifier(); ! if ( !id.equals(pid) ) throw new HibernateException( ! "The given proxy had a different identifier value to the given identifier: " + ! pid + "!=" + id ! ); ! } ! ! if ( !Hibernate.isInitialized(obj) ) { ! reassociateProxy(obj); ! return; ! } ! ! Object object = unproxyAndReassociate(obj); EntityEntry e = getEntry(object); if (e==null) { ! doUpdate(object, id); } else { *************** *** 1150,1154 **** } ! private void doUpdate(Object object, Object proxy, Serializable id) throws HibernateException { ClassPersister persister = getPersister(object); --- 1198,1202 ---- } ! private void doUpdate(Object object, Serializable id) throws HibernateException { ClassPersister persister = getPersister(object); *************** *** 1184,1188 **** addEntry(object, LOADED, null, id, persister.getVersion(object), LockMode.NONE, true, persister); //tableAccesses.add( persister.getQualifiedTableName() ); - if (proxy!=object) proxiesByKey.put(key, proxy); cascading++; --- 1232,1235 ---- *************** *** 1358,1362 **** if (lockMode==LockMode.WRITE) throw new HibernateException("Invalid lock mode for lock()"); ! object = HibernateProxyHelper.unproxy(object, this); EntityEntry e = getEntry(object); --- 1405,1411 ---- if (lockMode==LockMode.WRITE) throw new HibernateException("Invalid lock mode for lock()"); ! object = unproxyAndReassociate(object); ! //TODO: if object was an uninitialized proxy, this is inefficient, ! //resulting in two SQL selects EntityEntry e = getEntry(object); *************** *** 1562,1566 **** * Do NOT return a proxy. */ ! public Object immediateLoad(Class clazz, Serializable id) throws SQLException, HibernateException { Object result = doLoad(clazz, id, null, LockMode.NONE, false); throwObjectNotFound(result, id, clazz); --- 1611,1615 ---- * Do NOT return a proxy. */ ! public Object immediateLoad(Class clazz, Serializable id) throws HibernateException { Object result = doLoad(clazz, id, null, LockMode.NONE, false); throwObjectNotFound(result, id, clazz); *************** *** 1643,1647 **** if ( persister.hasProxy() ) { proxy = CGLIBLazyInitializer.getProxy( ! clazz, persister.getProxyInterfaces(), persister.getProxyGetIdentifierMethod(), id, this ); } --- 1692,1700 ---- if ( persister.hasProxy() ) { proxy = CGLIBLazyInitializer.getProxy( ! clazz, ! persister.getProxyInterfaces(), ! persister.getProxyGetIdentifierMethod(), ! id, ! this ); } *************** *** 1773,1786 **** } ! public void refresh(Object object, LockMode lockMode) throws HibernateException { ! if (object==null) throw new NullPointerException("attempted to refresh null"); ! object = HibernateProxyHelper.unproxy(object, this); EntityEntry e = removeEntry(object); if ( !e.existsInDatabase ) throw new HibernateException("this instance does not yet exist as a row in the database"); ! removeEntity( new Key(e.id, e.persister) ); try { e.persister.load( e.id, object, lockMode, this); --- 1826,1844 ---- } ! public void refresh(Object obj, LockMode lockMode) throws HibernateException { ! if (obj==null) throw new NullPointerException("attempted to refresh null"); ! if ( !Hibernate.isInitialized(obj) ) { ! reassociateProxy(obj); ! return; ! } ! Object object = unproxyAndReassociate(obj); EntityEntry e = removeEntry(object); if ( !e.existsInDatabase ) throw new HibernateException("this instance does not yet exist as a row in the database"); ! Key key = new Key(e.id, e.persister); ! removeEntity(key); try { e.persister.load( e.id, object, lockMode, this); *************** *** 2117,2120 **** --- 2175,2179 ---- } + // not for internal use: public Serializable getIdentifier(Object object) throws HibernateException { if (object instanceof HibernateProxy) { *************** *** 2904,2907 **** --- 2963,2974 ---- } + public boolean contains(Object object) { + if (object instanceof HibernateProxy) { + return HibernateProxyHelper.getLazyInitializer( (HibernateProxy) object ).getSession()==this; + } + else { + return entries.containsKey(object); + } + } } |
From: <one...@us...> - 2003-03-29 04:09:20
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate/expression Modified Files: Expression.java SQLExpression.java Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: Expression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/Expression.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Expression.java 12 Mar 2003 08:24:23 -0000 1.3 --- Expression.java 29 Mar 2003 04:08:46 -0000 1.4 *************** *** 89,93 **** */ public static Expression ge(String propertyName, Object value) { ! return new GtExpression(propertyName, value); } /** --- 89,93 ---- */ public static Expression ge(String propertyName, Object value) { ! return new GeExpression(propertyName, value); } /** Index: SQLExpression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/SQLExpression.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SQLExpression.java 9 Mar 2003 04:04:06 -0000 1.2 --- SQLExpression.java 29 Mar 2003 04:08:47 -0000 1.3 *************** *** 13,18 **** public class SQLExpression extends Expression { ! private String sql; ! private TypedValue[] typedValues; /** --- 13,18 ---- public class SQLExpression extends Expression { ! private final String sql; ! private final TypedValue[] typedValues; /** *************** *** 45,48 **** --- 45,49 ---- SQLExpression(String sql, Object[] values, Type[] types) { + this.sql = sql; typedValues = new TypedValue[values.length]; for ( int i=0; i<typedValues.length; i++ ) { |
From: <one...@us...> - 2003-03-29 04:09:20
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate/engine Modified Files: SessionFactoryImplementor.java SessionImplementor.java Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: SessionFactoryImplementor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/SessionFactoryImplementor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SessionFactoryImplementor.java 14 Jan 2003 13:42:09 -0000 1.5 --- SessionFactoryImplementor.java 29 Mar 2003 04:08:46 -0000 1.6 *************** *** 9,12 **** --- 9,13 ---- import net.sf.hibernate.HibernateException; import net.sf.hibernate.MappingException; + import net.sf.hibernate.SessionFactory; import net.sf.hibernate.persister.ClassPersister; import net.sf.hibernate.collection.CollectionPersister; *************** *** 20,24 **** * @see net.sf.hibernate.impl.SessionFactoryImpl */ ! public interface SessionFactoryImplementor extends Mapping { /** --- 21,25 ---- * @see net.sf.hibernate.impl.SessionFactoryImpl */ ! public interface SessionFactoryImplementor extends Mapping, SessionFactory { /** *************** *** 74,81 **** */ public String[] getImplementors(Class clazz); ! /** * Get the list of query imports */ ! public String[] getImports(); /** --- 75,86 ---- */ public String[] getImplementors(Class clazz); ! /* * Get the list of query imports */ ! //public String[] getImports(); ! /** ! * Get a class name, using query language imports ! */ ! public String getImportedClassName(String name); /** Index: SessionImplementor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/SessionImplementor.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SessionImplementor.java 19 Feb 2003 02:02:12 -0000 1.8 --- SessionImplementor.java 29 Mar 2003 04:08:46 -0000 1.9 *************** *** 80,84 **** * Load an instance immediately. Do not return a proxy. */ ! public Object immediateLoad(Class persistentClass, Serializable id) throws SQLException, HibernateException; /** --- 80,84 ---- * Load an instance immediately. Do not return a proxy. */ ! public Object immediateLoad(Class persistentClass, Serializable id) throws HibernateException; /** |
From: <one...@us...> - 2003-03-29 04:09:19
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate Modified Files: Hibernate.java Interceptor.java Session.java hibernate-mapping-2.0.dtd Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: Hibernate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Hibernate.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Hibernate.java 12 Mar 2003 12:28:57 -0000 1.8 --- Hibernate.java 29 Mar 2003 04:08:46 -0000 1.9 *************** *** 8,12 **** import java.sql.Blob; import java.sql.Clob; - import java.sql.SQLException; import net.sf.hibernate.collection.PersistentCollection; --- 8,11 ---- *************** *** 155,165 **** public static final NullableType CLASS = new ClassType(); /** - * Hibernate <tt>object</tt> type - */ - public static final Type OBJECT = new ObjectType(); - /** * Hibernate <tt>serializable</tt> type */ public static final NullableType SERIALIZABLE = new SerializableType(Serializable.class); --- 154,164 ---- public static final NullableType CLASS = new ClassType(); /** * Hibernate <tt>serializable</tt> type */ public static final NullableType SERIALIZABLE = new SerializableType(Serializable.class); + /** + * Hibernate <tt>object</tt> type + */ + public static final Type OBJECT = new ObjectType(); *************** *** 177,181 **** } /** ! * A Hibernate serializable type */ public static Type serializable(Class serializableClass) { --- 176,180 ---- } /** ! * A Hibernate <tt>serializable</tt> type */ public static Type serializable(Class serializableClass) { *************** *** 183,186 **** --- 182,192 ---- } /** + * A Hibernate <tt>any</tt> type + * @param identifierType the entity identifier type + */ + public static Type any(Type identifierType) { + return new ObjectType(identifierType); + } + /** * A Hibernate persistent object (entity) type * @param persistentClass a mapped entity class *************** *** 202,208 **** * @param proxy a persistable object, proxy, persistent collection or <tt>null</tt> * @throws HibernateException if we can't initialize the proxy at this time, eg. the <tt>Session</tt> was closed - * @throws SQLException */ ! public static void initialize(Object proxy) throws HibernateException, SQLException { if (proxy==null) { return; --- 208,213 ---- * @param proxy a persistable object, proxy, persistent collection or <tt>null</tt> * @throws HibernateException if we can't initialize the proxy at this time, eg. the <tt>Session</tt> was closed */ ! public static void initialize(Object proxy) throws HibernateException { if (proxy==null) { return; *************** *** 219,223 **** * Is the proxy or persistent collection initialized? * @param proxy a persistable object, proxy, persistent collection or <tt>null</tt> ! * @retrun true if the argument is already initialized, or is not a proxy or collection */ public static boolean isInitialized(Object proxy) { --- 224,228 ---- * Is the proxy or persistent collection initialized? * @param proxy a persistable object, proxy, persistent collection or <tt>null</tt> ! * @return true if the argument is already initialized, or is not a proxy or collection */ public static boolean isInitialized(Object proxy) { Index: Interceptor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Interceptor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Interceptor.java 9 Mar 2003 04:04:04 -0000 1.7 --- Interceptor.java 29 Mar 2003 04:08:46 -0000 1.8 *************** *** 89,93 **** * @param clazz a mapped class * @param id the identifier of the new instance ! * @return Object an instance of the class, or <tt>null</tt> to choose default behaviour */ public Object instantiate(Class clazz, Serializable id); --- 89,93 ---- * @param clazz a mapped class * @param id the identifier of the new instance ! * @return an instance of the class, or <tt>null</tt> to choose default behaviour */ public Object instantiate(Class clazz, Serializable id); Index: Session.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Session.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Session.java 22 Mar 2003 13:41:51 -0000 1.13 --- Session.java 29 Mar 2003 04:08:46 -0000 1.14 *************** *** 168,171 **** --- 168,178 ---- */ public Serializable getIdentifier(Object object) throws HibernateException; + /** + * Is this instance associated with this <tt>Session</tt>? + * + * @param object an instance of a persistent class + * @return true if the given instance is associated with this <tt>Session</tt> + */ + public boolean contains(Object object); /** Index: hibernate-mapping-2.0.dtd =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hibernate-mapping-2.0.dtd,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** hibernate-mapping-2.0.dtd 16 Mar 2003 01:45:52 -0000 1.16 --- hibernate-mapping-2.0.dtd 29 Mar 2003 04:08:46 -0000 1.17 *************** *** 19,26 **** <!-- The document root. --> ! <!ELEMENT hibernate-mapping (meta*, class*, query*)> <!ATTLIST hibernate-mapping schema CDATA #IMPLIED> <!-- default: none --> <!ATTLIST hibernate-mapping default-cascade (none|save-update|all) "none"> ! <!-- Root of an entity class hierarchy. Entities have their own tables. --> --- 19,32 ---- <!-- The document root. --> ! <!ELEMENT hibernate-mapping (meta*, import*, class*, query*)> <!ATTLIST hibernate-mapping schema CDATA #IMPLIED> <!-- default: none --> <!ATTLIST hibernate-mapping default-cascade (none|save-update|all) "none"> ! ! <!-- A query language "import" --> ! ! <!ELEMENT import EMPTY> ! <!ATTLIST import class CDATA #REQUIRED> ! <!ATTLIST import rename CDATA #IMPLIED> <!-- default: unqualified class name --> ! <!-- Root of an entity class hierarchy. Entities have their own tables. --> *************** *** 31,35 **** discriminator?, (version|timestamp)?, ! (property|many-to-one|one-to-one|component|dynabean|map|set|list|bag|array|primitive-array)*, ((subclass*)|(joined-subclass*)) )> --- 37,41 ---- discriminator?, (version|timestamp)?, ! (property|many-to-one|one-to-one|component|dynabean|any|map|set|list|bag|array|primitive-array)*, ((subclass*)|(joined-subclass*)) )> *************** *** 43,46 **** --- 49,53 ---- <!ATTLIST class persister CDATA #IMPLIED> <!ATTLIST class dynamic-update (true|false) "false"> + <!ATTLIST class import CDATA #IMPLIED> <!-- Declares the id type, column and generation algorithm for an entity class. *************** *** 92,96 **** <!ELEMENT subclass ( meta*, ! (property|many-to-one|one-to-one|component|map|set|list|bag|array|primitive-array)*, subclass* )> --- 99,103 ---- <!ELEMENT subclass ( meta*, ! (property|many-to-one|one-to-one|component|any|map|set|list|bag|array|primitive-array)*, subclass* )> *************** *** 99,102 **** --- 106,110 ---- <!ATTLIST subclass discriminator-value CDATA #IMPLIED> <!-- default: unqualified class name | none --> <!ATTLIST subclass dynamic-update (true|false) "false"> + <!ATTLIST subclass import CDATA #IMPLIED> <!-- Joined subclasses are used for the normalized table-per-subclass mapping strategy --> *************** *** 105,109 **** meta*, key, ! (property|many-to-one|one-to-one|component|map|set|list|bag|array|primitive-array)*, joined-subclass* )> --- 113,117 ---- meta*, key, ! (property|many-to-one|one-to-one|component|any|map|set|list|bag|array|primitive-array)*, joined-subclass* )> *************** *** 113,116 **** --- 121,125 ---- <!ATTLIST joined-subclass schema CDATA #IMPLIED> <!ATTLIST joined-subclass dynamic-update (true|false) "false"> + <!ATTLIST joined-subclass import CDATA #IMPLIED> <!-- Property of an entity class or component, component-element, composite-id, etc. *************** *** 166,170 **** <!ATTLIST key-many-to-one class CDATA #IMPLIED> <!ATTLIST key-many-to-one column CDATA #IMPLIED> ! <!-- A component is a user-defined class, persisted along with its containing entity to the table of the entity class. JavaBeans style properties of the component are --- 175,187 ---- <!ATTLIST key-many-to-one class CDATA #IMPLIED> <!ATTLIST key-many-to-one column CDATA #IMPLIED> ! ! <!-- An "any" association is a polymorphic association to any table with ! the given identifier type. The first listed column is a VARCHAR column ! holding the name of the class (for that row). --> ! ! <!ELEMENT any (column, column+)> ! <!ATTLIST any id-type CDATA #REQUIRED> ! <!ATTLIST any name CDATA #REQUIRED> ! <!-- A component is a user-defined class, persisted along with its containing entity to the table of the entity class. JavaBeans style properties of the component are *************** *** 175,179 **** <!ELEMENT component ( parent?, ! (property|many-to-one|one-to-one|component|dynabean|map|set|list|bag|array|primitive-array)* )> <!ATTLIST component class CDATA #IMPLIED> --- 192,196 ---- <!ELEMENT component ( parent?, ! (property|many-to-one|one-to-one|component|dynabean|any|map|set|list|bag|array|primitive-array)* )> <!ATTLIST component class CDATA #IMPLIED> *************** *** 181,185 **** <!ELEMENT dynabean ( ! (property|many-to-one|one-to-one|component|dynabean|map|set|list|bag|array|primitive-array)* )> <!ATTLIST dynabean dynaclass CDATA #REQUIRED> --- 198,202 ---- <!ELEMENT dynabean ( ! (property|many-to-one|one-to-one|component|dynabean|any|map|set|list|bag|array|primitive-array)* )> <!ATTLIST dynabean dynaclass CDATA #REQUIRED> |
From: <one...@us...> - 2003-03-29 04:09:19
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate/cfg Modified Files: Binder.java Configuration.java Environment.java Mappings.java Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: Binder.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Binder.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Binder.java 16 Mar 2003 01:45:52 -0000 1.9 --- Binder.java 29 Mar 2003 04:08:46 -0000 1.10 *************** *** 11,14 **** --- 11,15 ---- import net.sf.hibernate.engine.Cascades; import net.sf.hibernate.loader.OuterJoinLoader; + import net.sf.hibernate.mapping.Any; import net.sf.hibernate.mapping.Array; import net.sf.hibernate.mapping.Association; *************** *** 58,62 **** private static final Log log = LogFactory.getLog(Collection.class); ! public static void bindClass(Element node, PersistentClass model) throws MappingException { String className = node.attributeValue("name"); --- 59,63 ---- private static final Log log = LogFactory.getLog(Collection.class); ! public static void bindClass(Element node, PersistentClass model, Mappings mapping) throws MappingException { String className = node.attributeValue("name"); *************** *** 89,98 **** false : "true".equals( dynamicNode.getValue() ) ! ); } public static void bindSubclass(Element node, Subclass model, Mappings mappings) throws MappingException { ! bindClass(node, model); if ( model.getPersister()==null ) { --- 90,104 ---- false : "true".equals( dynamicNode.getValue() ) ! ); ! //IMPORT ! Attribute importNode = node.attribute("import"); ! if (importNode!=null) { ! mapping.addImport( className, importNode.getValue() ); ! } } public static void bindSubclass(Element node, Subclass model, Mappings mappings) throws MappingException { ! bindClass(node, model, mappings); if ( model.getPersister()==null ) { *************** *** 110,114 **** public static void bindJoinedSubclass(Element node, Subclass model, Mappings mappings) throws MappingException { ! bindClass(node, model); // joined subclasses --- 116,120 ---- public static void bindJoinedSubclass(Element node, Subclass model, Mappings mappings) throws MappingException { ! bindClass(node, model, mappings); // joined subclasses *************** *** 145,149 **** public static void bindRootClass(Element node, RootClass model, Mappings mappings) throws MappingException { ! bindClass(node, model); //TABLENAME --- 151,155 ---- public static void bindRootClass(Element node, RootClass model, Mappings mappings) throws MappingException { ! bindClass(node, model, mappings); //TABLENAME *************** *** 458,461 **** --- 464,472 ---- } } + + public static void bindAny(Element node, Any model, boolean isNullable) throws MappingException { + model.setIdentifierType( getTypeFromXML(node) ); + bindColumns(node, model, isNullable, false, null); + } public static void bindOneToOne(Element node, OneToOne model, boolean isNullable) throws MappingException { *************** *** 612,615 **** --- 623,630 ---- bindOneToOne(subnode, (OneToOne) value, isNullable); } + else if ( "any".equals(name) ) { + value = new Any( model.getTable() ); + bindAny(subnode, (Any) value, isNullable); + } else if ( "property".equals(name) || "key-property".equals(name) ) { value = new Value( model.getTable() ); *************** *** 668,672 **** private static Type getTypeFromXML(Element node) throws MappingException { Type type; ! Attribute typeNode = node.attribute("type"); if (typeNode==null) { return null; //we will have to use reflection --- 683,688 ---- private static Type getTypeFromXML(Element node) throws MappingException { Type type; ! Attribute typeNode = node.attribute("type"); ! if (typeNode==null) typeNode = node.attribute("id-type"); //for an any if (typeNode==null) { return null; //we will have to use reflection *************** *** 748,751 **** --- 764,771 ---- value = new ManyToOne(table); bindManyToOne(subnode, (ManyToOne) value, propertyName, true); + } + else if ( "any".equals(name) ) { + value = new Any(table); + bindAny(subnode, (Any) value, true); } else if ( "one-to-one".equals(name) ) { *************** *** 929,937 **** while ( nodes.hasNext() ) { Element n = (Element) nodes.next(); ! String qname = n.attribute("name").getValue(); String query = n.getText(); log.debug("Named query: " + qname + " -> " + query); model.addQuery(qname, query); } } --- 949,967 ---- while ( nodes.hasNext() ) { Element n = (Element) nodes.next(); ! String qname = n.attributeValue("name"); String query = n.getText(); log.debug("Named query: " + qname + " -> " + query); model.addQuery(qname, query); } + + nodes = hmNode.elementIterator("import"); + while ( nodes.hasNext() ) { + Element n = (Element) nodes.next(); + String className = n.attributeValue("class"); + Attribute renameNode = n.attribute("rename"); + String rename = (renameNode==null) ? StringHelper.unqualify(className) : renameNode.getValue(); + log.debug("Import: " + rename + " -> " + className); + model.addImport(className, rename); + } } Index: Configuration.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Configuration.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Configuration.java 17 Mar 2003 07:24:20 -0000 1.17 --- Configuration.java 29 Mar 2003 04:08:46 -0000 1.18 *************** *** 6,9 **** --- 6,10 ---- import java.util.ArrayList; import java.util.HashMap; + import java.util.Map; import java.util.Properties; import java.util.jar.JarFile; *************** *** 69,72 **** --- 70,74 ---- private HashMap classes = new HashMap(); + private HashMap imports = new HashMap(); private HashMap collections = new HashMap(); private HashMap tables = new HashMap(); *************** *** 199,203 **** */ public Mappings createMappings() { ! return new Mappings(classes, collections, tables, namedQueries, secondPasses); } --- 201,205 ---- */ public Mappings createMappings() { ! return new Mappings(classes, collections, tables, namedQueries, imports, secondPasses); } *************** *** 474,478 **** * Get the named queries */ ! public java.util.Map getNamedQueries() { return namedQueries; } --- 476,480 ---- * Get the named queries */ ! public Map getNamedQueries() { return namedQueries; } *************** *** 781,784 **** --- 783,795 ---- throw new MappingException("jcs-cache usage attribute should be read-write or read-only"); } + } + + /** + * Get the query language imports + * + * @return Map + */ + public Map getImports() { + return imports; } Index: Environment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Environment.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Environment.java 26 Mar 2003 10:47:55 -0000 1.6 --- Environment.java 29 Mar 2003 04:08:46 -0000 1.7 *************** *** 38,42 **** public final class Environment { ! private static final String VERSION = "2.0 beta 4"; /** --- 38,42 ---- public final class Environment { ! private static final String VERSION = "2.0 beta 5"; /** *************** *** 227,230 **** --- 227,231 ---- /** * A comma-seperated list of packages that need not be specified in a query + * @deprecated */ public static final String QUERY_IMPORTS = "hibernate.query.imports"; Index: Mappings.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Mappings.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Mappings.java 3 Feb 2003 12:11:36 -0000 1.4 --- Mappings.java 29 Mar 2003 04:08:46 -0000 1.5 *************** *** 27,38 **** private final Map queries; private final List secondPasses; private String schemaName; private String defaultCascade; ! Mappings(Map classes, Map collections, Map tables, Map queries, List secondPasses) { this.classes = classes; this.collections = collections; this.queries = queries; this.tables = tables; this.secondPasses = secondPasses; } --- 27,40 ---- private final Map queries; private final List secondPasses; + private final Map imports; private String schemaName; private String defaultCascade; ! Mappings(Map classes, Map collections, Map tables, Map queries, Map imports, List secondPasses) { this.classes = classes; this.collections = collections; this.queries = queries; this.tables = tables; + this.imports = imports; this.secondPasses = secondPasses; } *************** *** 51,54 **** --- 53,60 ---- public Collection getCollection(String role) { return (Collection) collections.get(role); + } + + public void addImport(String className, String rename) throws MappingException { + if ( imports.put(rename, className)!=null ) throw new MappingException("duplicate import: " + rename); } |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate/test Modified Files: ABC.hbm.xml ABCProxy.hbm.xml Bar.java BarProxy.java Baz.hbm.xml Blobber.hbm.xml Category.hbm.xml Circular.hbm.xml Container.hbm.xml Custom.hbm.xml Fee.hbm.xml Fo.hbm.xml Foo.java FooBar.hbm.xml FooBarTest.java Fum.hbm.xml Fumm.hbm.xml Glarch.hbm.xml Holder.hbm.xml Immutable.hbm.xml Location.hbm.xml Many.hbm.xml MasterDetail.hbm.xml Multi.hbm.xml Nameable.hbm.xml One.hbm.xml ParentChild.hbm.xml Qux.hbm.xml Simple.hbm.xml SingleSeveral.hbm.xml Stuff.hbm.xml Vetoer.hbm.xml Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: ABC.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ABC.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ABC.hbm.xml 9 Feb 2003 06:28:16 -0000 1.4 --- ABC.hbm.xml 29 Mar 2003 04:08:48 -0000 1.5 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.A" discriminator-value="0"> <id name = "id" unsaved-value = "null"> <generator class="vm"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.A" import="A" discriminator-value="0"> <id name = "id" unsaved-value = "null"> <generator class="vm"/> *************** *** 9,13 **** <discriminator column="clazz" type="integer" not-null="false"/> <property name="name"/> ! <subclass name="net.sf.hibernate.test.B" discriminator-value="-1"> <property name="count" column="count_"/> <subclass name="net.sf.hibernate.test.C1" discriminator-value="null"> --- 9,13 ---- <discriminator column="clazz" type="integer" not-null="false"/> <property name="name"/> ! <subclass name="net.sf.hibernate.test.B" import="B" discriminator-value="-1"> <property name="count" column="count_"/> <subclass name="net.sf.hibernate.test.C1" discriminator-value="null"> *************** *** 21,25 **** </class> ! <class name="net.sf.hibernate.test.D" discriminator-value="0" proxy="net.sf.hibernate.test.D"> <id name = "id" unsaved-value = "null"> <generator class="assigned"/> --- 21,25 ---- </class> ! <class name="net.sf.hibernate.test.D" discriminator-value="0" import="D" proxy="net.sf.hibernate.test.D"> <id name = "id" unsaved-value = "null"> <generator class="assigned"/> Index: ABCProxy.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ABCProxy.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ABCProxy.hbm.xml 16 Mar 2003 01:45:53 -0000 1.5 --- ABCProxy.hbm.xml 29 Mar 2003 04:08:48 -0000 1.6 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.A" discriminator-value="0" proxy="net.sf.hibernate.test.A"> <id name = "id" unsaved-value = "null"> <generator class="vm"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.A" discriminator-value="0" import="A" proxy="net.sf.hibernate.test.A"> <id name = "id" unsaved-value = "null"> <generator class="vm"/> *************** *** 9,19 **** <discriminator column="clazz" type="integer" force="true" not-null="false"/> <property name="name"/> ! <subclass name="net.sf.hibernate.test.B" discriminator-value="null" proxy="net.sf.hibernate.test.B"> <property name="count" column="count_"/> ! <subclass name="net.sf.hibernate.test.C1" discriminator-value="1" proxy="net.sf.hibernate.test.C1"> <property name="address" column="c1"/> <one-to-one name="d"/> </subclass> ! <subclass name="net.sf.hibernate.test.C2" discriminator-value="2" proxy="net.sf.hibernate.test.C2"> <property name="address" column="c2"/> </subclass> --- 9,19 ---- <discriminator column="clazz" type="integer" force="true" not-null="false"/> <property name="name"/> ! <subclass name="net.sf.hibernate.test.B" discriminator-value="null" import="B" proxy="net.sf.hibernate.test.B"> <property name="count" column="count_"/> ! <subclass name="net.sf.hibernate.test.C1" discriminator-value="1" import="C1" proxy="net.sf.hibernate.test.C1"> <property name="address" column="c1"/> <one-to-one name="d"/> </subclass> ! <subclass name="net.sf.hibernate.test.C2" discriminator-value="2" import="C2" proxy="net.sf.hibernate.test.C2"> <property name="address" column="c2"/> </subclass> *************** *** 21,25 **** </class> ! <class name="net.sf.hibernate.test.D" discriminator-value="0" proxy="net.sf.hibernate.test.D"> <id name = "id" unsaved-value = "null"> <generator class="assigned"/> --- 21,25 ---- </class> ! <class name="net.sf.hibernate.test.D" discriminator-value="0" proxy="net.sf.hibernate.test.D" import="D"> <id name = "id" unsaved-value = "null"> <generator class="assigned"/> Index: Bar.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Bar.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Bar.java 20 Mar 2003 13:59:09 -0000 1.4 --- Bar.java 29 Mar 2003 04:08:48 -0000 1.5 *************** *** 7,10 **** --- 7,11 ---- private Baz baz; private int x; + private Object object; public int getX() { *************** *** 48,52 **** this.name = name; } ! } --- 49,61 ---- this.name = name; } ! ! public Object getObject() { ! return object; ! } ! ! public void setObject(Object object) { ! this.object = object; ! } ! } Index: BarProxy.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/BarProxy.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BarProxy.java 5 Jan 2003 02:11:23 -0000 1.3 --- BarProxy.java 29 Mar 2003 04:08:49 -0000 1.4 *************** *** 9,12 **** --- 9,14 ---- //public void setBarString(String arg0); public String getBarString(); + public Object getObject(); + public void setObject(Object o); } Index: Baz.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Baz.hbm.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Baz.hbm.xml 9 Mar 2003 04:04:09 -0000 1.12 --- Baz.hbm.xml 29 Mar 2003 04:08:49 -0000 1.13 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Baz"> <id name="code" type="string"> <column name="baz_id" length="32"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Baz" import="Baz" > <id name="code" type="string"> <column name="baz_id" length="32"/> Index: Blobber.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Blobber.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Blobber.hbm.xml 15 Feb 2003 01:00:56 -0000 1.1 --- Blobber.hbm.xml 29 Mar 2003 04:08:49 -0000 1.2 *************** *** 2,6 **** <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> ! <class name="net.sf.hibernate.test.Blobber" dynamic-update="true"> <id name="id"> <generator class="hilo"/> --- 2,6 ---- <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> ! <class name="net.sf.hibernate.test.Blobber" import="Blobber" dynamic-update="true"> <id name="id"> <generator class="hilo"/> Index: Category.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Category.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Category.hbm.xml 28 Jan 2003 10:22:21 -0000 1.2 --- Category.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Category" table="category"> <id name="id" unsaved-value="0"> <generator class="native"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Category" import="Category" table="category"> <id name="id" unsaved-value="0"> <generator class="native"/> Index: Circular.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Circular.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Circular.hbm.xml 28 Jan 2003 10:22:21 -0000 1.2 --- Circular.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 *************** *** 3,7 **** <hibernate-mapping default-cascade="save-update"> ! <class name="net.sf.hibernate.test.Circular"> <id name="id" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> --- 3,7 ---- <hibernate-mapping default-cascade="save-update"> ! <class name="net.sf.hibernate.test.Circular" import="Circular" > <id name="id" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> Index: Container.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Container.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Container.hbm.xml 22 Mar 2003 04:39:49 -0000 1.5 --- Container.hbm.xml 29 Mar 2003 04:08:49 -0000 1.6 *************** *** 4,8 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Container" proxy="net.sf.hibernate.test.Container"> <id name="id" column="container_id"> <generator class="native" /> --- 4,8 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Container" import="Container" proxy="net.sf.hibernate.test.Container"> <id name="id" column="container_id"> <generator class="native" /> *************** *** 74,78 **** </class> ! <class name="net.sf.hibernate.test.Contained" proxy="net.sf.hibernate.test.Contained"> <id name="id" column="container_id" unsaved-value="0"> <generator class="native" /> --- 74,78 ---- </class> ! <class name="net.sf.hibernate.test.Contained" import="Contained" proxy="net.sf.hibernate.test.Contained"> <id name="id" column="container_id" unsaved-value="0"> <generator class="native" /> Index: Custom.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Custom.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Custom.hbm.xml 28 Jan 2003 10:22:21 -0000 1.3 --- Custom.hbm.xml 29 Mar 2003 04:08:49 -0000 1.4 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Custom" persister="net.sf.hibernate.test.CustomPersister"> <id type="string" name="key" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Custom" import="Custom" persister="net.sf.hibernate.test.CustomPersister"> <id type="string" name="key" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> Index: Fee.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Fee.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Fee.hbm.xml 22 Mar 2003 04:39:49 -0000 1.4 --- Fee.hbm.xml 29 Mar 2003 04:08:49 -0000 1.5 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fee"> <id type="string" name="key" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fee" import="Fee" > <id type="string" name="key" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> Index: Fo.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Fo.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Fo.hbm.xml 20 Mar 2003 13:59:09 -0000 1.3 --- Fo.hbm.xml 29 Mar 2003 04:08:49 -0000 1.4 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fo"> <composite-id class="net.sf.hibernate.test.FumCompositeID"> <key-property name="string"> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fo" import="Fo" table="foes"> <composite-id class="net.sf.hibernate.test.FumCompositeID"> <key-property name="string"> Index: Foo.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Foo.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Foo.java 20 Mar 2003 13:59:09 -0000 1.5 --- Foo.java 29 Mar 2003 04:08:49 -0000 1.6 *************** *** 71,74 **** --- 71,82 ---- this.x = x; } + + public Foo() { + } + + public Foo(int x) { + this.x=x; + } + public boolean onSave(Session db) throws CallbackException { _string = "a string"; Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBar.hbm.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FooBar.hbm.xml 20 Mar 2003 13:59:09 -0000 1.9 --- FooBar.hbm.xml 29 Mar 2003 04:08:49 -0000 1.10 *************** *** 3,6 **** --- 3,9 ---- <hibernate-mapping> + <import class="net.sf.hibernate.test.Result"/> + <import class="net.sf.hibernate.test.Named"/> + <class name="net.sf.hibernate.test.Foo" *************** *** 8,12 **** proxy="net.sf.hibernate.test.FooProxy" discriminator-value="F" ! dynamic-update="true"> <jcs-cache usage="read-write"/> --- 11,16 ---- proxy="net.sf.hibernate.test.FooProxy" discriminator-value="F" ! dynamic-update="true" ! import="Foo"> <jcs-cache usage="read-write"/> *************** *** 108,112 **** name="net.sf.hibernate.test.Bar" proxy="net.sf.hibernate.test.BarProxy" ! discriminator-value="B"> <many-to-one name="baz"/> <property name="barString"> --- 112,117 ---- name="net.sf.hibernate.test.Bar" proxy="net.sf.hibernate.test.BarProxy" ! discriminator-value="B" ! import="Bar" > <many-to-one name="baz"/> <property name="barString"> *************** *** 124,127 **** --- 129,136 ---- </array> </component> + <any name="object" id-type="long"> + <column name="clazz" length="100"/> + <column name="gen_id"/> + </any> </subclass> </subclass> Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** FooBarTest.java 25 Mar 2003 13:49:44 -0000 1.44 --- FooBarTest.java 29 Mar 2003 04:08:49 -0000 1.45 *************** *** 1032,1035 **** --- 1032,1043 ---- foo.setFoo(foo2); + List list = s.find( + "select foo, bar from Foo foo left outer join foo.foo bar where foo = ?", + foo, + Hibernate.association(Foo.class) + ); + Object[] row1 = (Object[]) list.get(0); + assertTrue( row1[0]==foo && row1[1]==foo2 ); + s.find("select foo.foo.foo.string from foo in class Foo where foo.foo = 'bar'"); s.find("select foo.foo.foo.foo.string from foo in class Foo where foo.foo.foo = 'bar'"); *************** *** 1049,1052 **** --- 1057,1063 ---- } + s.find("from Foo as foo where foo.component.glarch.name is not null"); + s.find("from Foo as foo left outer join foo.component.glarch as glarch where glarch.name = 'foo'"); + /*Query q = s.createQuery("from foo in class Foo where foo.string = ? or foo.string = ? or foo.string in (:list)"); q.setString(0, "foo"); *************** *** 1057,1061 **** q.list();*/ ! List list = s.find("from foo in class net.sf.hibernate.test.Foo where foo.string='osama bin laden' and foo.boolean = true order by foo.string asc, foo.component.count desc"); assertTrue( list.size()==0, "empty query" ); Iterator iter = s.iterate("from foo in class net.sf.hibernate.test.Foo where foo.string='osama bin laden' order by foo.string asc, foo.component.count desc"); --- 1068,1072 ---- q.list();*/ ! list = s.find("from foo in class net.sf.hibernate.test.Foo where foo.string='osama bin laden' and foo.boolean = true order by foo.string asc, foo.component.count desc"); assertTrue( list.size()==0, "empty query" ); Iterator iter = s.iterate("from foo in class net.sf.hibernate.test.Foo where foo.string='osama bin laden' order by foo.string asc, foo.component.count desc"); *************** *** 1178,1181 **** --- 1189,1194 ---- list = s.find( "from foo in class Foo where foo.boolean = ?", new Boolean(true), Hibernate.BOOLEAN ); + s.find("select new Foo(fo.x) from Fo fo"); + list = s.find("select foo.long, foo.component.name, foo, foo.foo from foo in class Foo"); rs = list.iterator(); *************** *** 2760,2763 **** --- 2773,2820 ---- } + public void testOneToOneGenerator() throws Exception { + Session s = sessions.openSession(); + X x = new X(); + Y y = new Y(); + x.setY(y); + s.save(y); + s.save(x); + s.flush(); + s.connection().commit(); + s.close(); + } + + public void testAny() throws Exception { + Session s = sessions.openSession(); + One one = new One(); + BarProxy foo = new Bar(); + foo.setObject(one); + Serializable oid = s.save(one); + Serializable fid = s.save(foo); + s.flush(); + s.connection().commit(); + s.close(); + s = sessions.openSession(); + assertTrue( s.find( + "from Bar bar where bar.object.id = ? and bar.object.class = ?", + new Object[] { oid, One.class }, + new Type[] { Hibernate.LONG, Hibernate.CLASS } + ).size()==1 ); + assertTrue( s.find( + "select one from One one, Bar bar where bar.object.id = one.id and bar.object.class = 'net.sf.hibernate.test.One'" + ).size()==1 ); + s.flush(); + s.connection().commit(); + s.close(); + s = sessions.openSession(); + foo = (BarProxy) s.load(Foo.class, fid); + assertTrue( foo.getObject()!=null && foo.getObject() instanceof One && s.getIdentifier( foo.getObject() ).equals(oid) ); + s.delete( foo.getObject() ); + s.delete(foo); + s.flush(); + s.connection().commit(); + s.close(); + } + public void testEmbeddedCompositeID() throws Exception { Session s = sessions.openSession(); *************** *** 2938,2942 **** "Stuff.hbm.xml", "Container.hbm.xml", ! "Simple.hbm.xml" } ); return new TestSuite(FooBarTest.class); --- 2995,3000 ---- "Stuff.hbm.xml", "Container.hbm.xml", ! "Simple.hbm.xml", ! "XY.hbm.xml" } ); return new TestSuite(FooBarTest.class); Index: Fum.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Fum.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Fum.hbm.xml 28 Jan 2003 10:22:21 -0000 1.2 --- Fum.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fum"> <composite-id name="id" unsaved-value="any"> <key-property name="string"> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fum" import="Fum"> <composite-id name="id" unsaved-value="any"> <key-property name="string"> Index: Fumm.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Fumm.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Fumm.hbm.xml 28 Jan 2003 10:22:21 -0000 1.2 --- Fumm.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fumm"> <composite-id name="id"> <key-property name="string"> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Fumm" import="Fumm"> <composite-id name="id"> <key-property name="string"> Index: Glarch.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Glarch.hbm.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Glarch.hbm.xml 22 Mar 2003 04:39:49 -0000 1.8 --- Glarch.hbm.xml 29 Mar 2003 04:08:49 -0000 1.9 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Glarch" table="glarchez" proxy="net.sf.hibernate.test.GlarchProxy"> <!--<jcs-cache usage="read-write"/>--> <id type="string" column="tha_key" length="32"> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Glarch" table="glarchez" import="Glarch" proxy="net.sf.hibernate.test.GlarchProxy"> <!--<jcs-cache usage="read-write"/>--> <id type="string" column="tha_key" length="32"> Index: Holder.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Holder.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Holder.hbm.xml 28 Jan 2003 10:22:21 -0000 1.2 --- Holder.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 *************** *** 2,6 **** <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> ! <class name="net.sf.hibernate.test.Holder"> <id name="id" column="id_" type="string" length="32" unsaved-value="null"> <generator class="uuid.hex"/> </id> <property name="name" unique="true" not-null="true" length="36"/> <list name="ones"> <key column="holder"/> <index column="i"/> <one-to-many class="net.sf.hibernate.test.One"/> </list> <array name="fooArray"> <key column="holder1"/> <index column="j1"/> <one-to-many class="net.sf.hibernate.test.Foo"/> </array> --- 2,6 ---- <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> ! <class name="net.sf.hibernate.test.Holder" import="Holder"> <id name="id" column="id_" type="string" length="32" unsaved-value="null"> <generator class="uuid.hex"/> </id> <property name="name" unique="true" not-null="true" length="36"/> <list name="ones"> <key column="holder"/> <index column="i"/> <one-to-many class="net.sf.hibernate.test.One"/> </list> <array name="fooArray"> <key column="holder1"/> <index column="j1"/> <one-to-many class="net.sf.hibernate.test.Foo"/> </array> Index: Immutable.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Immutable.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Immutable.hbm.xml 28 Jan 2003 10:22:21 -0000 1.3 --- Immutable.hbm.xml 29 Mar 2003 04:08:49 -0000 1.4 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Immutable" table="immut" mutable="false"> <jcs-cache usage="read-only"/> <id name="id" column="id_" length="64"> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Immutable" import="Immutable" table="immut" mutable="false"> <jcs-cache usage="read-only"/> <id name="id" column="id_" length="64"> Index: Location.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Location.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Location.hbm.xml 28 Jan 2003 10:22:21 -0000 1.2 --- Location.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Location"> <composite-id> <key-property name="streetNumber"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Location" import="Location"> <composite-id> <key-property name="streetNumber"/> Index: Many.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Many.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Many.hbm.xml 20 Mar 2003 13:59:10 -0000 1.5 --- Many.hbm.xml 29 Mar 2003 04:08:49 -0000 1.6 *************** *** 4,8 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Many" table="many"> <id name="key" column="many_key" unsaved-value="0"> <generator class="native" /> --- 4,8 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Many" import="Many" table="many"> <id name="key" column="many_key" unsaved-value="0"> <generator class="native" /> Index: MasterDetail.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/MasterDetail.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MasterDetail.hbm.xml 20 Mar 2003 13:59:10 -0000 1.5 --- MasterDetail.hbm.xml 29 Mar 2003 04:08:49 -0000 1.6 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Master"> <id column="master_key" type="long"> <generator class="native"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Master" import="Master"> <id column="master_key" type="long"> <generator class="native"/> *************** *** 32,36 **** </class> ! <class name="net.sf.hibernate.test.Detail"> <id column="detail_key" type="long"> <generator class="native"/> --- 32,36 ---- </class> ! <class name="net.sf.hibernate.test.Detail" import="Detail"> <id column="detail_key" type="long"> <generator class="native"/> *************** *** 46,50 **** </class> ! <class name="net.sf.hibernate.test.SubDetail"> <id column="subdetail_key" type="long"> <generator class="native"> --- 46,50 ---- </class> ! <class name="net.sf.hibernate.test.SubDetail" import="SubDetail"> <id column="subdetail_key" type="long"> <generator class="native"> Index: Multi.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Multi.hbm.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Multi.hbm.xml 17 Mar 2003 07:24:20 -0000 1.6 --- Multi.hbm.xml 29 Mar 2003 04:08:49 -0000 1.7 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Simple" table="rootclass" dynamic-update="true"> <jcs-cache usage="read-write"/> <id type="long" column="id_" > --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Simple" table="rootclass" import="Simple" dynamic-update="true"> <jcs-cache usage="read-write"/> <id type="long" column="id_" > *************** *** 13,17 **** <property name="date" column="date_"/> ! <joined-subclass name="net.sf.hibernate.test.Mono" table="mono"> <key column="superid"/> <set name="strings" table="monostrings"> --- 13,17 ---- <property name="date" column="date_"/> ! <joined-subclass name="net.sf.hibernate.test.Mono" import="Mono" table="mono"> <key column="superid"/> <set name="strings" table="monostrings"> *************** *** 21,29 **** </joined-subclass> ! <joined-subclass name="net.sf.hibernate.test.TrivialClass"> <key column="tcid"/> </joined-subclass> ! <joined-subclass name="net.sf.hibernate.test.LessSimple" table="leafsubclass"> <key column="id__"/> <property name="intprop" not-null="true"/> --- 21,29 ---- </joined-subclass> ! <joined-subclass name="net.sf.hibernate.test.TrivialClass" import="TrivialClass"> <key column="tcid"/> </joined-subclass> ! <joined-subclass name="net.sf.hibernate.test.LessSimple" import="LessSimple" table="leafsubclass"> <key column="id__"/> <property name="intprop" not-null="true"/> *************** *** 43,47 **** </joined-subclass> ! <joined-subclass name="net.sf.hibernate.test.Multi" table="nonleafsubclass" dynamic-update="true"> <key column="sid"/> <property name="extraProp"/> --- 43,47 ---- </joined-subclass> ! <joined-subclass name="net.sf.hibernate.test.Multi" table="nonleafsubclass" import="Multi" dynamic-update="true"> <key column="sid"/> <property name="extraProp"/> *************** *** 54,58 **** </component> ! <joined-subclass name="net.sf.hibernate.test.SubMulti" table="leafsubsubclass"> <key column="sid"/> <property name="amount"/> --- 54,58 ---- </component> ! <joined-subclass name="net.sf.hibernate.test.SubMulti" import="SubMulti" table="leafsubsubclass"> <key column="sid"/> <property name="amount"/> *************** *** 68,72 **** </class> ! <class name="net.sf.hibernate.test.Po"> <id type="long" column="id_"> <generator class="native"/> --- 68,72 ---- </class> ! <class name="net.sf.hibernate.test.Po" import="Po"> <id type="long" column="id_"> <generator class="native"/> Index: Nameable.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Nameable.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Nameable.hbm.xml 28 Jan 2003 10:22:21 -0000 1.2 --- Nameable.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Nameable"> <id name="key" column="key_"> <generator class="native"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Nameable" import="Nameable"> <id name="key" column="key_"> <generator class="native"/> Index: One.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/One.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** One.hbm.xml 20 Mar 2003 13:59:10 -0000 1.5 --- One.hbm.xml 29 Mar 2003 04:08:49 -0000 1.6 *************** *** 4,8 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.One" table="one"> <id name="key" column="one_key" unsaved-value="0"> <generator class="native" /> --- 4,8 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.One" import="One" table="one"> <id name="key" column="one_key" unsaved-value="0"> <generator class="native" /> Index: ParentChild.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ParentChild.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ParentChild.hbm.xml 20 Mar 2003 13:59:10 -0000 1.5 --- ParentChild.hbm.xml 29 Mar 2003 04:08:49 -0000 1.6 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Parent"> <id name="id" type="long"> <generator class="native"> <!--seqhilo--> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Parent" import="Parent"> <id name="id" type="long"> <generator class="native"> <!--seqhilo--> *************** *** 18,22 **** </class> ! <class name="net.sf.hibernate.test.Child"> <id name="id" type="long"> <generator class="assigned"/> --- 18,22 ---- </class> ! <class name="net.sf.hibernate.test.Child" import="Child"> <id name="id" type="long"> <generator class="assigned"/> Index: Qux.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Qux.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Qux.hbm.xml 28 Jan 2003 10:22:21 -0000 1.4 --- Qux.hbm.xml 29 Mar 2003 04:08:49 -0000 1.5 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Qux" table="quux" proxy="net.sf.hibernate.test.Qux"> <!----> <id name="key" column="qux_key" unsaved-value="0"> <generator class="hilo"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Qux" table="quux" import="Qux" proxy="net.sf.hibernate.test.Qux"> <!----> <id name="key" column="qux_key" unsaved-value="0"> <generator class="hilo"/> Index: Simple.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Simple.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Simple.hbm.xml 28 Jan 2003 10:22:21 -0000 1.2 --- Simple.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Simple"> <id type="long" column="id_"> <generator class="assigned"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Simple" import="Simple"> <id type="long" column="id_"> <generator class="assigned"/> Index: SingleSeveral.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/SingleSeveral.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SingleSeveral.hbm.xml 28 Jan 2003 10:22:21 -0000 1.2 --- SingleSeveral.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 *************** *** 5,9 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Single"> <composite-id> <key-property name="id" length="32"/> --- 5,9 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Single" import="Single"> <composite-id> <key-property name="id" length="32"/> *************** *** 20,24 **** </class> ! <class name="net.sf.hibernate.test.Several"> <composite-id> <key-property name="id" length="32"/> --- 20,24 ---- </class> ! <class name="net.sf.hibernate.test.Several" import="Several"> <composite-id> <key-property name="id" length="32"/> Index: Stuff.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Stuff.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Stuff.hbm.xml 28 Jan 2003 10:22:21 -0000 1.2 --- Stuff.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.MoreStuff"> <composite-id> <key-property name="intId"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.MoreStuff" import="MoreStuff"> <composite-id> <key-property name="intId"/> *************** *** 19,23 **** </class> ! <class name="net.sf.hibernate.test.Stuff"> <composite-id> <key-property name="id"/> --- 19,23 ---- </class> ! <class name="net.sf.hibernate.test.Stuff" import="Stuff"> <composite-id> <key-property name="id"/> Index: Vetoer.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Vetoer.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Vetoer.hbm.xml 28 Jan 2003 10:22:21 -0000 1.2 --- Vetoer.hbm.xml 29 Mar 2003 04:08:49 -0000 1.3 *************** *** 3,7 **** <hibernate-mapping> ! <class name="net.sf.hibernate.test.Vetoer"> <id type="string" column="id_" length="32"> <generator class="uuid.hex"/> --- 3,7 ---- <hibernate-mapping> ! <class name="net.sf.hibernate.test.Vetoer" import="Vetoer"> <id type="string" column="id_" length="32"> <generator class="uuid.hex"/> |
From: <one...@us...> - 2003-03-29 04:08:56
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate/tool/hbm2java Modified Files: AbstractRenderer.java BasicRenderer.java Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: AbstractRenderer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/AbstractRenderer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractRenderer.java 25 Mar 2003 07:08:37 -0000 1.1 --- AbstractRenderer.java 29 Mar 2003 04:08:49 -0000 1.2 *************** *** 7,13 **** package net.sf.hibernate.tool.hbm2java; - import java.io.PrintWriter; - import java.util.Iterator; - import java.util.List; import java.util.Map; import java.util.TreeSet; --- 7,10 ---- *************** *** 23,33 **** /** ! * Returns the true name for the given class name. By true name is ! * that it will return the Proxy for the class name if the class was ! * defined with a proxy attribute. ! * @param field class name that we use to serach in class2classmap ! * @param class2classmap a map from classname to classmappings ! * @return String return either name or the proxy name of the classmap ! */ static protected String getTrueTypeName(Field field, Map class2classmap) { String name = --- 20,30 ---- /** ! * Returns the true name for the given class name. By true name is ! * that it will return the Proxy for the class name if the class was ! * defined with a proxy attribute. ! * @param field class name that we use to serach in class2classmap ! * @param class2classmap a map from classname to classmappings ! * @return String return either name or the proxy name of the classmap ! */ static protected String getTrueTypeName(Field field, Map class2classmap) { String name = *************** *** 58,69 **** /** ! * Returns the last part of type if it is in the set of imports. ! * e.g. java.util.Date would become Date, if imports contains ! * java.util.Date. ! * ! * @param type ! * @param imports ! * @return String ! */ protected String shortenType(String type, TreeSet imports) { if( imports.contains(type) ) { --- 55,66 ---- /** ! * Returns the last part of type if it is in the set of imports. ! * e.g. java.util.Date would become Date, if imports contains ! * java.util.Date. ! * ! * @param type ! * @param imports ! * @return String ! */ protected String shortenType(String type, TreeSet imports) { if( imports.contains(type) ) { *************** *** 81,89 **** /** ! * Convert string into something that can be rendered nicely into a javadoc ! * comment. ! * Prefix each line with a star ('*'). ! * @param string ! */ protected String toJavaDoc(String string, int indent) { StringBuffer result = new StringBuffer(); --- 78,86 ---- /** ! * Convert string into something that can be rendered nicely into a javadoc ! * comment. ! * Prefix each line with a star ('*'). ! * @param string ! */ protected String toJavaDoc(String string, int indent) { StringBuffer result = new StringBuffer(); Index: BasicRenderer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/BasicRenderer.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** BasicRenderer.java 25 Mar 2003 07:08:37 -0000 1.12 --- BasicRenderer.java 29 Mar 2003 04:08:49 -0000 1.13 *************** *** 9,17 **** import java.util.List; import java.util.Map; - import java.util.TreeSet; import net.sf.hibernate.util.StringHelper; - import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; --- 9,15 ---- |
From: <one...@us...> - 2003-03-29 04:08:55
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate/util Modified Files: ArrayHelper.java Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: ArrayHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/ArrayHelper.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ArrayHelper.java 20 Jan 2003 12:48:17 -0000 1.4 --- ArrayHelper.java 29 Mar 2003 04:08:49 -0000 1.5 *************** *** 83,86 **** --- 83,93 ---- return result; } + + public static int[] join(int[] x, int[] y) { + int[] result = new int[ x.length + y.length ]; + for ( int i=0; i<x.length; i++ ) result[i] = x[i]; + for ( int i=0; i<y.length; i++ ) result[i+x.length] = y[i]; + return result; + } } |
From: <one...@us...> - 2003-03-29 04:08:55
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/xml In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate/xml Modified Files: XMLDatabinder.java Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: XMLDatabinder.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/xml/XMLDatabinder.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** XMLDatabinder.java 9 Feb 2003 06:28:17 -0000 1.6 --- XMLDatabinder.java 29 Mar 2003 04:08:50 -0000 1.7 *************** *** 176,180 **** if ( value!=null ) { String[] properties = componenttype.getPropertyNames(); ! Object[] subvalues = componenttype.getPropertyValues(value); Type[] subtypes = componenttype.getSubtypes(); for ( int j=0; j<properties.length; j++ ) { --- 176,180 ---- if ( value!=null ) { String[] properties = componenttype.getPropertyNames(); ! Object[] subvalues = componenttype.getPropertyValues(value); //We know that null is okay here .. at least for ComponentType .... TODO: something safer?? Type[] subtypes = componenttype.getSubtypes(); for ( int j=0; j<properties.length; j++ ) { |