Author: mdryakhlenkov
Date: 2007-07-12 11:38:49 -0400 (Thu, 12 Jul 2007)
New Revision: 2409
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Address.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Company.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Customer.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Person.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/interceptor/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/interceptor/Customer.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/tuplizer/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/tuplizer/Customer.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ecid/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ecid/Course.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ecid/Course.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ecid/UniversityCourse.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/basic/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/basic/AB.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/basic/Account.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/basic/Employer.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/Car.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/Car.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/CarPart.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/CarType.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/map/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/map/basic/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/map/basic/ProductLine.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Stock.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Stock.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Valuation.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Valuation.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/Group.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/Group.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/User.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/User.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Customer.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Customer.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Employee.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Employee.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Person.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Person.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/allinone.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/allseparateinone.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/entitynames.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/packageentitynames.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/unionsubclass.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/Document.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/Group.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/SessionAttribute.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/User.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/UserGroup.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/Account.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/BankAccount.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/Person.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/Person.java
Log:
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Address.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Address.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Address.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,18 @@
+package mapping.dynamicentity;
+
+/**
+ * @author <a href="mailto:steve@hibernate.org">Steve Ebersole
</a>
+ */
+public interface Address {
+ public Long getId();
+ public void setId(Long id);
+
+ public String getStreet();
+ public void setStreet(String street);
+
+ public String getCity();
+ public void setCity(String city);
+
+ public String getPostalCode();
+ public void setPostalCode(String postalCode);
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Company.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Company.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Company.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,11 @@
+package mapping.dynamicentity;
+
+/**
+ * @author <a href="mailto:steve@hibernate.org">Steve Ebersole
</a>
+ */
+public interface Company {
+ public Long getId();
+ public void setId(Long id);
+ public String getName();
+ public void setName(String name);
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Customer.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Customer.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Customer.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,9 @@
+package mapping.dynamicentity;
+
+/**
+ * @author <a href="mailto:steve@hibernate.org">Steve Ebersole
</a>
+ */
+public interface Customer extends Person {
+ public Company getCompany();
+ public void setCompany(Company company);
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Person.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Person.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/Person.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,17 @@
+package mapping.dynamicentity;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:steve@hibernate.org">Steve Ebersole
</a>
+ */
+public interface Person {
+ public Long getId();
+ public void setId(Long id);
+ public String getName();
+ public void setName(String name);
+ public Address getAddress();
+ public void setAddress(Address address);
+ public Set getFamily();
+ public void setFamily(Set family);
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/interceptor/Customer.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/interceptor/Customer.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/interceptor/Customer.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="mapping.dynamicentity">
+
+ <!--
+ Mapping the Customer and Company interfaces. Our custom Interceptor
+ will be responsible for: a) creating instances representing these
+ interfaces; b) determining the appropriate entity-name (i.e., which
+ entity mapping to use) given an instance of one of these proxies.
+ -->
+ <class name="Person" table="t_person"
abstract="false">
+ <!-- <class name="Person" table="t_person"
discriminator-value="person"> -->
+ <id name="id">
+ <generator class="native"/>
+ </id>
+ <discriminator force="false"/>
+ <property name="name"/>
+
+ <many-to-one name="address" cascade="all"
column="addr_id"/>
+
+ <set name="family" lazy="true"
cascade="all">
+ <key column="pers_id"/>
+ <one-to-many class="Person"/>
+ </set>
+
+ <subclass name="Customer" discriminator-value="customer"
abstract="false">
+ <many-to-one name="company" cascade="none"
column="comp_id"/>
+ </subclass>
+ </class>
+
+ <!-- Company interface mapping -->
+ <class name="Company" table="t_company"
abstract="false">
+ <id name="id">
+ <generator class="native"/>
+ </id>
+ <property name="name"/>
+ </class>
+
+ <class name="Address" table="t_address"
abstract="false">
+ <id name="id">
+ <generator class="native"/>
+ </id>
+ <property name="street"/>
+ <property name="city"/>
+ <property name="postalCode"/>
+ </class>
+
+</hibernate-mapping>
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/tuplizer/Customer.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/tuplizer/Customer.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/dynamicentity/tuplizer/Customer.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="mapping.dynamicentity">
+
+ <!--
+ Mapping the Customer and Company interfaces. Our custom Interceptor
+ will be responsible for: a) creating instances representing these
+ interfaces; b) determining the appropriate entity-name (i.e., which
+ entity mapping to use) given an instance of one of these proxies.
+ -->
+ <class name="Person" table="t_person"
discriminator-value="person" abstract="false">
+ <tuplizer
class="org.hibernate.test.dynamicentity.tuplizer.MyEntityTuplizer"
entity-mode="pojo"/>
+ <id name="id">
+ <generator class="native"/>
+ </id>
+ <discriminator force="false"/>
+ <property name="name"/>
+
+ <many-to-one name="address" cascade="all"
column="addr_id"/>
+
+ <set name="family" lazy="true"
cascade="all">
+ <key column="pers_id"/>
+ <one-to-many class="Person"/>
+ </set>
+
+ <subclass name="Customer" discriminator-value="customer"
abstract="false">
+ <tuplizer
class="org.hibernate.test.dynamicentity.tuplizer.MyEntityTuplizer"
entity-mode="pojo"/>
+ <many-to-one name="company" cascade="none"
column="comp_id"/>
+ </subclass>
+ </class>
+
+ <!-- Company interface mapping -->
+ <class name="Company" table="t_company"
abstract="false">
+ <tuplizer
class="org.hibernate.test.dynamicentity.tuplizer.MyEntityTuplizer"
entity-mode="pojo"/>
+ <id name="id">
+ <generator class="native"/>
+ </id>
+ <property name="name"/>
+ </class>
+
+ <class name="Address" table="t_address"
abstract="false">
+ <tuplizer
class="org.hibernate.test.dynamicentity.tuplizer.MyEntityTuplizer"
entity-mode="pojo"/>
+ <id name="id">
+ <generator class="native"/>
+ </id>
+ <property name="street"/>
+ <property name="city"/>
+ <property name="postalCode"/>
+ </class>
+
+</hibernate-mapping>
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ecid/Course.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ecid/Course.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ecid/Course.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+ package="mapping.ecid"
+ default-access="field">
+
+<!--
+
+ This mapping demonstrates inheritance with embedded composite ids.
+
+-->
+
+ <class name="Course" table="SchoolCourses"
+ discriminator-value="secondary/primary">
+ <composite-id>
+ <key-property name="courseCode"/>
+ <key-property name="org"/>
+ </composite-id>
+ <discriminator column="schoolLevel" length="20"/>
+ <property name="description" not-null="true"/>
+ <subclass name="UniversityCourse"
discriminator-value="tertiary">
+ <property name="semester"/>
+ </subclass>
+ </class>
+
+</hibernate-mapping>
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ecid/Course.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ecid/Course.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ecid/Course.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,38 @@
+//$Id: Course.java 6913 2005-05-25 17:37:51Z oneovthafew $
+package mapping.ecid;
+
+import java.io.Serializable;
+
+/**
+ * @author Gavin King
+ */
+public class Course implements Serializable {
+
+ private String courseCode;
+ private String org;
+ private String description;
+
+ Course() {}
+ Course(String courseCode, String org, String description) {
+ this.courseCode = courseCode;
+
this.org = org;
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getCourseCode() {
+ return courseCode;
+ }
+
+ public String getOrg() {
+ return org;
+ }
+
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ecid/UniversityCourse.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ecid/UniversityCourse.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ecid/UniversityCourse.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,22 @@
+//$Id: UniversityCourse.java 6913 2005-05-25 17:37:51Z oneovthafew $
+package mapping.ecid;
+
+/**
+ * @author Gavin King
+ */
+public class UniversityCourse extends Course {
+
+ private int semester;
+
+ UniversityCourse() {}
+
+ public UniversityCourse(String courseCode, String org, String description, int semester)
{
+ super( courseCode, org, description );
+ this.semester = semester;
+ }
+
+ public int getSemester() {
+ return semester;
+ }
+
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/basic/AB.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/basic/AB.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/basic/AB.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping >
+
+ <class entity-name="A" table="AX" node="a">
+ <id name="aId" type="int" column="aId"
node="@id"/>
+ <property name="x" type="string"/>
+ <set name="bs" node="." embed-xml="true"
cascade="all" inverse="true">
+ <key column="aId"/>
+ <one-to-many class="B"/>
+ </set>
+ </class>
+
+
+ <class entity-name="B" table="BX" node="b">
+ <composite-id>
+ <key-property name="bId" column="bId"
type="int" node="@bId"/>
+ <key-property name="aId" column="aId"
type="int" node="@aId"/>
+ </composite-id>
+ <property name="y" type="string" node="."/>
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/basic/Account.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/basic/Account.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/basic/Account.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+
+ <class entity-name="Customer" node="customer">
+ <id name="customerId" type="string"
node="@id"/>
+ <component name="name">
+ <property name="first" type="string"/>
+ <property name="last" type="string"/>
+ </component>
+ <property name="address" type="string"
node="address"/>
+ <map name="stuff">
+ <key column="customerId"/>
+ <map-key type="string" column="bar"
node="@bar"/>
+ <element type="string" node="foo"
column="foo"/>
+ </map>
+ <bag name="morestuff" node=".">
+ <key column="customerId"/>
+ <element type="integer" node="amount"
column="amount"/>
+ </bag>
+ <list name="accounts" cascade="all">
+ <key column="customerId2"/>
+ <list-index column="acctno" base="1"/>
+ <one-to-many entity-name="Account"
node="account"/>
+ </list>
+ <many-to-one name="location" node="location/@id"
entity-name="Location" embed-xml="false"/>
+ <property name="description" node="."
type="string"/>
+ <set name="unembedded" embed-xml="false">
+ <key column="x"/>
+ <element type="string" column="y"
not-null="true"/>
+ </set>
+ </class>
+
+ <class entity-name="Account" node="account">
+ <id name="accountId" type="string"
node="@id"/>
+ <many-to-one name="customer" column="customerId"
entity-name="Customer" cascade="all" embed-xml="true" />
+ <!--not-null="true"-->
+ <property name="balance" type="big_decimal"
node="balance" precision="10" scale="0" />
+ </class>
+
+ <class entity-name="Location" node="location">
+ <id name="id" node="@id" type="long">
+ <generator class="increment"/>
+ </id>
+ <property name="address" type="string"/>
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/basic/Employer.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/basic/Employer.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/basic/Employer.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+ <class entity-name="Employer" node="employer">
+ <id name="id" node="@id" type="long">
+ <generator class="increment"/>
+ </id>
+ <property name="name" node="@name" type="string"/>
+ <set name="employees" node="."
cascade="all,delete-orphan" fetch="join" lazy="false">
+ <key not-null="true" column="employerId"/>
+ <one-to-many entity-name="Employee" />
+ </set>
+ </class>
+
+ <class entity-name="Employee" node="employee">
+ <id name="id" node="@id" type="long">
+ <generator class="increment"/>
+ </id>
+ <discriminator column="role" type="string"
length="10"/>
+ <property name="name" node="@name" type="string"/>
+ <subclass entity-name="Techie" node="techie" />
+ <subclass entity-name="Salesdude" node="sales-dude"/>
+ </class>
+
+ <class entity-name="Department" node="department">
+ <id name="id" node="@id" type="long">
+ <generator class="increment"/>
+ </id>
+ <property name="name" node="@name"
type="string"/>
+ <many-to-one name="manager" entity-name="Employee"
cascade="all" fetch="join" lazy="false"
embed-xml="true" node="manager" />
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/Car.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/Car.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/Car.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="mapping.entitymode.dom4j.many2one">
+
+ <class name="Car" lazy="false" node="car">
+ <id name="id" node="@id" type="long">
+ <generator class="increment"/>
+ </id>
+ <property name="model" type="string"
node="model"/>
+ <many-to-one name="carType" node="carType"
class="CarType"/>
+ <set name="carParts" node="." cascade="all">
+ <key column="car" not-null="true"/>
+ <one-to-many class="CarPart" node="carPart"
embed-xml="false"/>
+ </set>
+ </class>
+
+ <class name="CarType" lazy="true" node="carType">
+ <id name="id" node="@id" type="long">
+ <generator class="increment"/>
+ </id>
+ <property name="typeName" type="string"
node="typeName"/>
+ </class>
+
+ <class name="CarPart" node="carPart">
+ <id name="id" node="@id" type="long">
+ <generator class="increment"/>
+ </id>
+ <property name="partName" type="string"
node="partName"/>
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/Car.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/Car.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/Car.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,58 @@
+package mapping.entitymode.dom4j.many2one;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author Paco Hern�ndez
+ */
+public class Car implements java.io.Serializable {
+
+ private long id;
+ private String model;
+ private CarType carType;
+ private Set carParts = new HashSet();
+
+ /**
+ * @return Returns the carType.
+ */
+ public CarType getCarType() {
+ return carType;
+ }
+ /**
+ * @param carType The carType to set.
+ */
+ public void setCarType(CarType carType) {
+ this.carType = carType;
+ }
+ /**
+ * @return Returns the id.
+ */
+ public long getId() {
+ return id;
+ }
+ /**
+ * @param id The id to set.
+ */
+ public void setId(long id) {
+ this.id = id;
+ }
+ /**
+ * @return Returns the model.
+ */
+ public String getModel() {
+ return model;
+ }
+ /**
+ * @param model The model to set.
+ */
+ public void setModel(String model) {
+ this.model = model;
+ }
+ public Set getCarParts() {
+ return carParts;
+ }
+ public void setCarParts(Set carParts) {
+ this.carParts = carParts;
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/CarPart.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/CarPart.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/CarPart.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,35 @@
+package mapping.entitymode.dom4j.many2one;
+
+/**
+ * @author Paco Hern�ndez
+ */
+public class CarPart implements java.io.Serializable {
+
+ private long id;
+ private String partName;
+
+ /**
+ * @return Returns the id.
+ */
+ public long getId() {
+ return id;
+ }
+ /**
+ * @param id The id to set.
+ */
+ public void setId(long id) {
+ this.id = id;
+ }
+ /**
+ * @return Returns the typeName.
+ */
+ public String getPartName() {
+ return partName;
+ }
+ /**
+ * @param typeName The typeName to set.
+ */
+ public void setPartName(String typeName) {
+ this.partName = typeName;
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/CarType.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/CarType.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/dom4j/many2one/CarType.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,35 @@
+package mapping.entitymode.dom4j.many2one;
+
+/**
+ * @author Paco Hern�ndez
+ */
+public class CarType implements java.io.Serializable {
+
+ private long id;
+ private String typeName;
+
+ /**
+ * @return Returns the id.
+ */
+ public long getId() {
+ return id;
+ }
+ /**
+ * @param id The id to set.
+ */
+ public void setId(long id) {
+ this.id = id;
+ }
+ /**
+ * @return Returns the typeName.
+ */
+ public String getTypeName() {
+ return typeName;
+ }
+ /**
+ * @param typeName The typeName to set.
+ */
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/map/basic/ProductLine.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/map/basic/ProductLine.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/map/basic/ProductLine.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+
+<!--
+ This mapping demonstrates "dynamic" entities.
+-->
+
+ <class entity-name="ProductLine">
+ <id name="id" column="productId" length="32"
type="string">
+ <generator class="uuid.hex"/>
+ </id>
+
+ <property name="description" not-null="true"
length="200" type="string"/>
+
+ <!-- don't use sets for associations, unless you want stack overflows!
-->
+ <bag name="models" cascade="all"
inverse="true">
+ <key column="productId"/>
+ <one-to-many class="Model"/>
+ </bag>
+
+ </class>
+
+ <class entity-name="Model">
+ <id name="id" column="modelId" length="32"
type="string">
+ <generator class="uuid.hex"/>
+ </id>
+
+ <property name="name" not-null="true" length="25"
type="string"/>
+ <property name="description" not-null="true"
length="200" type="string"/>
+ <many-to-one name="productLine" column="productId"
not-null="true" class="ProductLine"/>
+
+ </class>
+
+</hibernate-mapping>
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Stock.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Stock.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Stock.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping
+ SYSTEM
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+
+<hibernate-mapping package="mapping.entitymode.multi">
+
+ <class table="STOCK" name="Stock" node="stock">
+
+ <id name="id" column="STOCK_ID" node="@id">
+ <generator class="increment"/>
+ </id>
+
+ <property name="tradeSymbol" type="string"
column="SYMBOL"/>
+
+ <many-to-one name="currentValuation" class="Valuation"
column="CURR_VAL_ID" cascade="all" />
+
+ <set name="valuations" cascade="all" lazy="true">
+ <key column="STOCK_ID"/>
+ <one-to-many class="Valuation"/>
+ </set>
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Stock.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Stock.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Stock.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,49 @@
+// $Id: Stock.java 5686 2005-02-12 07:27:32Z steveebersole $
+package mapping.entitymode.multi;
+
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * POJO implementation of Stock entity.
+ *
+ * @author Steve Ebersole
+ */
+public class Stock {
+ private Long id;
+ private String tradeSymbol;
+ private Valuation currentValuation;
+ private Set valuations = new HashSet();
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getTradeSymbol() {
+ return tradeSymbol;
+ }
+
+ public void setTradeSymbol(String tradeSymbol) {
+ this.tradeSymbol = tradeSymbol;
+ }
+
+ public Valuation getCurrentValuation() {
+ return currentValuation;
+ }
+
+ public void setCurrentValuation(Valuation currentValuation) {
+ this.currentValuation = currentValuation;
+ }
+
+ public Set getValuations() {
+ return valuations;
+ }
+
+ public void setValuations(Set valuations) {
+ this.valuations = valuations;
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Valuation.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Valuation.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Valuation.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping
+ SYSTEM
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+
+<hibernate-mapping package="mapping.entitymode.multi">
+
+ <class table="STOCK_VAL" name="Valuation"
node="valuation">
+
+ <id name="id" column="VAL_ID" node="@id">
+ <generator class="increment"/>
+ </id>
+
+ <many-to-one name="stock" embed-xml="false"
+ class="Stock" column="STOCK_ID" cascade="none" />
+
+ <property name="valuationDate" type="date"
column="DT"/>
+ <property name="value" type="double"
column="VAL"/>
+
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Valuation.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Valuation.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/entitymode/multi/Valuation.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,48 @@
+// $Id: Valuation.java 5686 2005-02-12 07:27:32Z steveebersole $
+package mapping.entitymode.multi;
+
+import java.util.Date;
+
+/**
+ * Implementation of Valuation.
+ *
+ * @author Steve Ebersole
+ */
+public class Valuation {
+ private Long id;
+ private Stock stock;
+ private Date valuationDate;
+ private Double value;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Stock getStock() {
+ return stock;
+ }
+
+ public void setStock(Stock stock) {
+ this.stock = stock;
+ }
+
+ public Date getValuationDate() {
+ return valuationDate;
+ }
+
+ public void setValuationDate(Date valuationDate) {
+ this.valuationDate = valuationDate;
+ }
+
+ public Double getValue() {
+ return value;
+ }
+
+ public void setValue(Double value) {
+ this.value = value;
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/Group.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/Group.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/Group.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping SYSTEM
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+
+<hibernate-mapping package="mapping.exception" >
+ <class name="Group" table="T_GROUP" >
+ <id name="id" unsaved-value="null" column="group_id"
>
+ <generator class="native"/>
+ </id>
+ <property name="name" type="string" column="name"
/>
+ <set name="members" inverse="true"
table="T_MEMBERSHIP" cascade="none">
+ <key column="group_id"/>
+ <many-to-many class="User" column="user_id"/>
+ </set>
+ </class>
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/Group.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/Group.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/Group.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,48 @@
+// $Id: Group.java 4746 2004-11-11 20:57:28Z steveebersole $
+package mapping.exception;
+
+import java.util.Set;
+
+/**
+ * Implementation of Group.
+ *
+ * @author Steve Ebersole
+ */
+public class Group {
+ private Long id;
+ private String name;
+ private Set members;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Set getMembers() {
+ return members;
+ }
+
+ public void setMembers(Set members) {
+ this.members = members;
+ }
+
+ public void addMember(User member) {
+ if (member == null) {
+ throw new IllegalArgumentException("Member to add cannot be null");
+ }
+
+ this.members.add(member);
+ member.getMemberships().add(this);
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/User.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/User.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/User.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping SYSTEM
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+
+<hibernate-mapping package="mapping.exception" >
+ <class name="User" table="T_USER" >
+ <id name="id" unsaved-value="null" column="user_id"
>
+ <generator class="native"/>
+ </id>
+ <property name="username" type="string"
column="user_name" />
+ <set name="memberships" inverse="false"
table="T_MEMBERSHIP" cascade="none">
+ <key column="user_id"/>
+ <many-to-many class="Group" column="group_id"/>
+ </set>
+ </class>
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/User.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/User.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/exception/User.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,49 @@
+// $Id: User.java 4746 2004-11-11 20:57:28Z steveebersole $
+package mapping.exception;
+
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * Implementation of User.
+ *
+ * @author Steve Ebersole
+ */
+public class User {
+ private Long id;
+ private String username;
+ private Set memberships = new HashSet();
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public Set getMemberships() {
+ return memberships;
+ }
+
+ public void setMemberships(Set memberships) {
+ this.memberships = memberships;
+ }
+
+ public void addMembership(Group membership) {
+ if (membership == null) {
+ throw new IllegalArgumentException("Membership to add cannot be null");
+ }
+
+ this.memberships.add(membership);
+ membership.getMembers().add(this);
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Customer.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Customer.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Customer.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<!--
+
+ This mapping demonstrates
+
+-->
+
+<hibernate-mapping package="mapping.extendshbm">
+ <subclass name="Customer" extends="Person">
+ <property name="comments"/>
+ <many-to-one name="salesperson"/>
+ </subclass>
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Customer.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Customer.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Customer.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,35 @@
+//$Id: Customer.java 5011 2004-12-19 22:01:25Z maxcsaucdk $
+package mapping.extendshbm;
+
+/**
+ * @author Gavin King
+ */
+public class Customer extends Person {
+ private Employee salesperson;
+ private String comments;
+
+ /**
+ * @return Returns the salesperson.
+ */
+ public Employee getSalesperson() {
+ return salesperson;
+ }
+ /**
+ * @param salesperson The salesperson to set.
+ */
+ public void setSalesperson(Employee salesperson) {
+ this.salesperson = salesperson;
+ }
+ /**
+ * @return Returns the comments.
+ */
+ public String getComments() {
+ return comments;
+ }
+ /**
+ * @param comments The comments to set.
+ */
+ public void setComments(String comments) {
+ this.comments = comments;
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Employee.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Employee.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Employee.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<!--
+
+ This mapping demonstrates
+
+-->
+
+<hibernate-mapping package="mapping.extendshbm">
+ <subclass name="Employee" extends="Person">
+ <property name="title"
+ length="20"/>
+ <property name="salary"
+ length="0"/>
+ <many-to-one name="manager"/>
+ </subclass>
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Employee.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Employee.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Employee.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,49 @@
+//$Id: Employee.java 5011 2004-12-19 22:01:25Z maxcsaucdk $
+package mapping.extendshbm;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Gavin King
+ */
+public class Employee extends Person {
+ private String title;
+ private BigDecimal salary;
+ private Employee manager;
+ /**
+ * @return Returns the title.
+ */
+ public String getTitle() {
+ return title;
+ }
+ /**
+ * @param title The title to set.
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+ /**
+ * @return Returns the manager.
+ */
+ public Employee getManager() {
+ return manager;
+ }
+ /**
+ * @param manager The manager to set.
+ */
+ public void setManager(Employee manager) {
+ this.manager = manager;
+ }
+ /**
+ * @return Returns the salary.
+ */
+ public BigDecimal getSalary() {
+ return salary;
+ }
+ /**
+ * @param salary The salary to set.
+ */
+ public void setSalary(BigDecimal salary) {
+ this.salary = salary;
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Person.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Person.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Person.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<!--
+
+ This mapping demonstrates
+
+-->
+
+<hibernate-mapping package="mapping.extendshbm">
+ <class name="Person">
+
+ <id name="id"
+ column="person_id"
+ unsaved-value="0">
+ <generator class="native"/>
+ </id>
+
+ <discriminator
+ type="string"
+ />
+
+ <property name="name"
+ not-null="true"
+ length="80"/>
+
+ </class>
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Person.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Person.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/Person.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,50 @@
+//$Id: Person.java 5011 2004-12-19 22:01:25Z maxcsaucdk $
+package mapping.extendshbm;
+
+
+/**
+ * @author Gavin King
+ */
+public class Person {
+ private long id;
+ private String name;
+ private char sex;
+
+ /**
+ * @return Returns the sex.
+ */
+ public char getSex() {
+ return sex;
+ }
+ /**
+ * @param sex The sex to set.
+ */
+ public void setSex(char sex) {
+ this.sex = sex;
+ }
+ /**
+ * @return Returns the id.
+ */
+ public long getId() {
+ return id;
+ }
+ /**
+ * @param id The id to set.
+ */
+ public void setId(long id) {
+ this.id = id;
+ }
+ /**
+ * @return Returns the identity.
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param identity The identity to set.
+ */
+ public void setName(String identity) {
+ this.name = identity;
+ }
+
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/allinone.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/allinone.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/allinone.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<!--
+
+ This mapping demonstrates
+
+-->
+
+<hibernate-mapping
+ package="mapping.extendshbm">
+
+ <class name="Person">
+
+ <id name="id"
+ column="person_id"
+ unsaved-value="0">
+ <generator class="native"/>
+ </id>
+
+ <discriminator
+ type="string"/>
+
+ <property name="name"
+ not-null="true"
+ length="80"/>
+
+ <subclass name="Employee">
+ <property name="title"
+ length="20"/>
+ <property name="salary"
+ length="0"/>
+ <many-to-one name="manager"/>
+ </subclass>
+
+ <subclass name="Customer">
+ <property name="comments"/>
+ <many-to-one name="salesperson"/>
+ </subclass>
+
+ </class>
+
+
+</hibernate-mapping>
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/allseparateinone.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/allseparateinone.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/allseparateinone.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<!--
+
+ This mapping demonstrates
+
+-->
+
+<hibernate-mapping
+ package="mapping.extendshbm">
+
+ <class name="Person">
+
+ <id name="id"
+ column="person_id"
+ unsaved-value="0">
+ <generator class="native"/>
+ </id>
+
+ <discriminator
+ type="string"/>
+
+ <property name="name"
+ not-null="true"
+ length="80"/>
+
+ <subclass name="Employee">
+ <property name="title"
+ length="20"/>
+ <property name="salary"
+ length="0"/>
+ <many-to-one name="manager"/>
+ </subclass>
+
+
+
+ </class>
+
+
+ <subclass name="Customer" extends="Person">
+ <property name="comments"/>
+ <many-to-one name="salesperson"/>
+ </subclass>
+
+
+</hibernate-mapping>
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/entitynames.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/entitynames.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/entitynames.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,18 @@
+<!DOCTYPE hibernate-mapping
+ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+ <class lazy="true" entity-name="EntityHasName"
table="F5_ENTITY_HASNAME">
+ <id name="id" column="ID" type="long">
+ <generator class="native"/>
+ </id>
+ <property name="attrName" type="string">
+ <column name="NAME"/>
+ </property>
+ </class>
+ <joined-subclass lazy="true" entity-name="EntityCompany"
table="F5_ENTITY_COMPANY" extends="EntityHasName">
+ <key column="REF_ID"/>
+ <many-to-one name="parent"
entity-name="EntityHasName"/>
+ </joined-subclass>
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/packageentitynames.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/packageentitynames.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/packageentitynames.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,18 @@
+<!DOCTYPE hibernate-mapping
+ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="mapping.extendshbm">
+ <class lazy="true" entity-name="EntityHasName"
table="F5_ENTITY_HASNAME">
+ <id name="id" column="ID" type="long">
+ <generator class="native"/>
+ </id>
+ <property name="attrName" type="string">
+ <column name="NAME"/>
+ </property>
+ </class>
+ <joined-subclass lazy="true" entity-name="EntityCompany"
table="F5_ENTITY_COMPANY" extends="EntityHasName">
+ <key column="REF_ID"/>
+ <many-to-one name="parent"
entity-name="EntityHasName"/>
+ </joined-subclass>
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/unionsubclass.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/unionsubclass.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extendshbm/unionsubclass.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<!--
+
+ This mapping demonstrates
+
+-->
+
+<hibernate-mapping
+ package="mapping.extendshbm">
+
+ <class name="Person">
+
+ <id name="id"
+ column="person_id"
+ unsaved-value="0">
+ <generator class="native"/>
+ </id>
+
+ <discriminator
+ type="string"/>
+
+ <property name="name"
+ not-null="true"
+ length="80"/>
+
+ </class>
+
+
+ <union-subclass name="Customer" extends="Person">
+ <property name="comments"/>
+ <many-to-one name="salesperson"/>
+ </union-subclass>
+
+ <subclass name="Employee" extends="Person">
+ <property name="title"
+ length="20"/>
+ <property name="salary"
+ length="0"/>
+ <many-to-one name="manager"/>
+ </subclass>
+
+</hibernate-mapping>
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/Document.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/Document.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/Document.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,38 @@
+//$Id: Document.java 7635 2005-07-24 23:04:30Z oneovthafew $
+package mapping.extralazy;
+
+public class Document {
+
+ private String title;
+ private String content;
+ private User owner;
+
+ Document() {}
+
+ public Document(String title, String content, User owner) {
+ this.content = content;
+ this.owner = owner;
+ this.title = title;
+ owner.getDocuments().add(this);
+ }
+
+ public String getContent() {
+ return content;
+ }
+ public void setContent(String content) {
+ this.content = content;
+ }
+ public User getOwner() {
+ return owner;
+ }
+ public void setOwner(User owner) {
+ this.owner = owner;
+ }
+ public String getTitle() {
+ return title;
+ }
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/Group.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/Group.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/Group.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,29 @@
+//$Id: Group.java 7628 2005-07-24 06:55:01Z oneovthafew $
+package mapping.extralazy;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Gavin King
+ */
+public class Group {
+ private String name;
+ private Map users = new HashMap();
+ Group() {}
+ public Group(String n) {
+ name = n;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public Map getUsers() {
+ return users;
+ }
+ public void setUsers(Map users) {
+ this.users = users;
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/SessionAttribute.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/SessionAttribute.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/SessionAttribute.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,41 @@
+//$Id: SessionAttribute.java 7628 2005-07-24 06:55:01Z oneovthafew $
+package mapping.extralazy;
+
+import java.io.Serializable;
+
+/**
+ * @author Gavin King
+ */
+public class SessionAttribute {
+ private Long id;
+ private String name;
+ private String stringData;
+ private Serializable objectData;
+ SessionAttribute() {}
+ public SessionAttribute(String name, Serializable obj) {
+ this.name = name;
+ this.objectData = obj;
+ }
+ public SessionAttribute(String name, String str) {
+ this.name = name;
+ this.stringData = str;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public Serializable getObjectData() {
+ return objectData;
+ }
+ public void setObjectData(Serializable objectData) {
+ this.objectData = objectData;
+ }
+ public String getStringData() {
+ return stringData;
+ }
+ public void setStringData(String stringData) {
+ this.stringData = stringData;
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/User.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/User.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/User.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,46 @@
+//$Id: User.java 7635 2005-07-24 23:04:30Z oneovthafew $
+package mapping.extralazy;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author Gavin King
+ */
+public class User {
+ private String name;
+ private String password;
+ private Map session = new HashMap();
+ private Set documents = new HashSet();
+ User() {}
+ public User(String n, String pw) {
+ name=n;
+ password = pw;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getPassword() {
+ return password;
+ }
+ public void setPassword(String password) {
+ this.password = password;
+ }
+ public Map getSession() {
+ return session;
+ }
+ public void setSession(Map session) {
+ this.session = session;
+ }
+ public Set getDocuments() {
+ return documents;
+ }
+ public void setDocuments(Set documents) {
+ this.documents = documents;
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/UserGroup.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/UserGroup.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/extralazy/UserGroup.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<!--
+
+-->
+
+<hibernate-mapping package="mapping.extralazy">
+
+ <class name="Group" table="groups">
+ <id name="name"/>
+ <map name="users" cascade="persist"
+ table="group_user" lazy="extra">
+ <key column="groupName"/>
+ <map-key formula="lower(personName)" type="string"/>
+ <many-to-many column="personName" class="User"/>
+ </map>
+ </class>
+
+ <class name="User" table="users">
+ <id name="name"/>
+ <property name="password"/>
+ <map name="session" lazy="extra"
+ cascade="persist,save-update,delete,delete-orphan">
+ <key column="userName" not-null="true"/>
+ <map-key column="name" type="string"/>
+ <one-to-many class="SessionAttribute"/>
+ </map>
+ <set name="documents" inverse="true"
+ lazy="extra" cascade="all,delete-orphan">
+ <key column="owner"/>
+ <one-to-many class="Document"/>
+ </set>
+ </class>
+
+ <class name="Document" table="documents">
+ <id name="title"/>
+ <property name="content" type="text"/>
+ <many-to-one name="owner" not-null="true"/>
+ </class>
+
+ <class name="SessionAttribute" table="session_attributes">
+ <id name="id" access="field">
+ <generator class="native"/>
+ </id>
+ <property name="name" not-null="true"
+ insert="false" update="false"/>
+ <property name="stringData"/>
+ <property name="objectData"/>
+ </class>
+
+ <sql-query name="userSessionData">
+ <return alias="u" class="User"/>
+ <return-join alias="s" property="u.session"/>
+ select
+ lower(u.name) as {u.name}, lower(u.password) as {u.password},
+ lower(s.userName) as {s.key}, lower(s.name) as {s.index}, s.id as {s.element},
+ {s.element.*}
+ from users u
+ join session_attributes s on lower(s.userName) = lower(u.name)
+ where u.name like :uname
+ </sql-query>
+
+
+</hibernate-mapping>
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/Account.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/Account.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/Account.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,38 @@
+//$Id: Account.java 10921 2006-12-05 14:39:12Z steve.ebersole(a)jboss.com $
+package mapping.propertyref.inheritence.joined;
+
+import java.io.Serializable;
+
+/**
+ * @author Gavin King
+ */
+public class Account implements Serializable {
+ private String accountId;
+ private char type;
+
+ /**
+ * @return Returns the accountId.
+ */
+ public String getAccountId() {
+ return accountId;
+ }
+ /**
+ * @param accountId The accountId to set.
+ */
+ public void setAccountId(String accountId) {
+ this.accountId = accountId;
+ }
+ /**
+ * @return Returns the type.
+ */
+ public char getType() {
+ return type;
+ }
+ /**
+ * @param type The type to set.
+ */
+ public void setType(char type) {
+ this.type = type;
+ }
+
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/BankAccount.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/BankAccount.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/BankAccount.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,23 @@
+//$Id: BankAccount.java 10921 2006-12-05 14:39:12Z steve.ebersole(a)jboss.com $
+package mapping.propertyref.inheritence.joined;
+
+public class BankAccount extends Account {
+ private String accountNumber;
+ private String bsb;
+
+ public String getAccountNumber() {
+ return accountNumber;
+ }
+
+ public void setAccountNumber(String accountNumber) {
+ this.accountNumber = accountNumber;
+ }
+
+ public String getBsb() {
+ return bsb;
+ }
+
+ public void setBsb(String bsb) {
+ this.bsb = bsb;
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/Person.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/Person.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/Person.hbm.xml 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<!--
+
+ Demonstrates the use of property-ref to map legacy data where
+ foreign keys reference something other than the primary key of
+ the associated entity. Here we show:
+
+ (1) A one-to-one foreign key association (prefer primary key
+ associations)
+
+ (2) A bidirectional one-to-many association on a key that is
+ not the primary key (prefer associations from foreign keys
+ to primary keys)
+
+-->
+
+<hibernate-mapping package="mapping.propertyref.inheritence.joined">
+
+ <class name="Person" table="J_SBCLS_PROPREF_PERS">
+ <id name="id">
+ <generator class="hilo"/>
+ </id>
+ <property name="name" length="100"/>
+ <many-to-one name="bankAccount" property-ref="bsbAccountNumber"
cascade="all">
+ <column name="bsb"/>
+ <column name="accountNumber"/>
+ </many-to-one>
+ </class>
+
+ <class name="Account" table="J_SBCLS_PROPREF_ACCT">
+ <id name="accountId" length="32">
+ <generator class="uuid"/>
+ </id>
+ <property name="type" not-null="true"/>
+ <joined-subclass name="BankAccount"
table="J_SBCLS_PROPREF_BACCT">
+ <key column="accountId"/>
+ <properties unique="true" name="bsbAccountNumber">
+ <property name="bsb" length="4"
not-null="true"/>
+ <property name="accountNumber" length="16"
not-null="true"/>
+ </properties>
+ </joined-subclass>
+
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/Person.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/Person.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/joined/Person.java 2007-07-12
15:38:49 UTC (rev 2409)
@@ -0,0 +1,44 @@
+//$Id: Person.java 10921 2006-12-05 14:39:12Z steve.ebersole(a)jboss.com $
+package mapping.propertyref.inheritence.joined;
+
+
+/**
+ * @author gavin
+ */
+public class Person {
+ private Long id;
+ private String name;
+ private BankAccount bankAccount;
+
+ /**
+ * @return Returns the id.
+ */
+ public Long getId() {
+ return id;
+ }
+ /**
+ * @param id The id to set.
+ */
+ public void setId(Long id) {
+ this.id = id;
+ }
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public BankAccount getBankAccount() {
+ return bankAccount;
+ }
+ public void setBankAccount(BankAccount bankAccount) {
+ this.bankAccount = bankAccount;
+ }
+}