|
From: Doug C. <de...@fl...> - 2002-02-04 09:50:23
|
I am making progress on a MappingByReflection class.
Given the list of classes:
cirrus.hibernate.test.Qux
cirrus.hibernate.test.Foo
cirrus.hibernate.test.Foo$Struct
cirrus.hibernate.test.Bar
cirrus.hibernate.test.Baz
cirrus.hibernate.test.Qux
it makes the XML below.
I am pleased that subclassing is working, and that I am
finding the properties. I use interface Persistent to
determine when to stop climing the superclass chain.
The next step is to do something more sensible with the
type info, and separate out arrays and components.
I'm afraid the only way to find the id is through naming
heuristics. I'm open to suggestions.
e
/*
<!-- Class cirrus.hibernate.test.Foo$Struct isn't Persistent! -->
<!-- cirrus.hibernate.test.Qux already added -->
<hibernate-mapping>
<!-- cirrus.hibernate.test.Qux root -->
<class name="cirrus.hibernate.test.Qux" table="Qux" select="distinct">
<property name="foo" type="class cirrus.hibernate.test.Foo">
<property name="created" type="boolean">
<property name="deleted" type="boolean">
<property name="loaded" type="boolean">
<property name="stored" type="boolean">
<property name="key" type="long">
<property name="stuff" type="class java.lang.String">
<property name="fums" type="interface java.util.Set">
<property name="moreFums" type="interface java.util.List">
</class>
<!-- cirrus.hibernate.test.Foo root -->
<class name="cirrus.hibernate.test.Foo" table="Foo" select="distinct">
<property name="foo" type="class cirrus.hibernate.test.Foo">
<property name="key" type="class java.lang.String">
<property name="string" type="class java.lang.String">
<property name="date" type="class java.util.Date">
<property name="timestamp" type="class java.util.Date">
<property name="integer" type="class java.lang.Integer">
<property name="long" type="class java.lang.Long">
<property name="short" type="class java.lang.Short">
<property name="float" type="class java.lang.Float">
<property name="double" type="class java.lang.Double">
<property name="boolean" type="class java.lang.Boolean">
<property name="bytes" type="class [B">
<property name="zero" type="float">
<property name="bool" type="boolean">
<property name="int" type="int">
<property name="null" type="class java.lang.Integer">
<property name="byte" type="class java.lang.Byte">
<property name="yesno" type="boolean">
<property name="blob" type="interface java.io.Serializable">
<property name="nullBlob" type="interface java.io.Serializable">
<property name="status" type="class cirrus.hibernate.test.FooStatus">
<property name="binary" type="class [B">
<property name="custom" type="class [Ljava.lang.String;">
<property name="component" type="class cirrus.hibernate.test.FooComponent">
<!-- cirrus.hibernate.test.Bar -->
<subclass name="cirrus.hibernate.test.Bar" table="Bar" select="distinct">
<property name="barString" type="class java.lang.String">
<property name="barComponent" type="class cirrus.hibernate.test.FooComponent">
</subclass>
</class>
<!-- cirrus.hibernate.test.Baz root -->
<class name="cirrus.hibernate.test.Baz" table="Baz" select="distinct">
<property name="stringSet" type="interface java.util.Set">
<property name="stringDateMap" type="interface java.util.Map">
<property name="stringList" type="interface java.util.List">
<property name="intArray" type="class [I">
<property name="fooArray" type="class [Lcirrus.hibernate.test.Foo;">
<property name="stringArray" type="class [Ljava.lang.String;">
<property name="setArray" type="class [Ljava.util.Set;">
<property name="stringArrayMap" type="interface java.util.Map">
<property name="setList" type="interface java.util.List">
<property name="code" type="class java.lang.String">
<property name="customs" type="interface java.util.List">
<property name="fooSet" type="interface java.util.Set">
<property name="components" type="class [Lcirrus.hibernate.test.FooComponent;">
</class>
</hibernate-mapping>
*/
|