Author: mdryakhlenkov
Date: 2007-07-17 12:33:24 -0400 (Tue, 17 Jul 2007)
New Revision: 2479
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/formulajoin/Detail.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/formulajoin/Master.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/formulajoin/Master.java
Log:
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/formulajoin/Detail.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/formulajoin/Detail.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/formulajoin/Detail.java 2007-07-17
16:33:24 UTC (rev 2479)
@@ -0,0 +1,46 @@
+//$Id: Detail.java 4602 2004-09-26 11:42:47Z oneovthafew $
+package mapping.formulajoin;
+
+import java.io.Serializable;
+
+/**
+ * @author Gavin King
+ */
+public class Detail implements Serializable {
+ private Long id;
+ private Master master;
+ private int version;
+ private String details;
+ private boolean currentVersion;
+
+ public boolean isCurrentVersion() {
+ return currentVersion;
+ }
+ public void setCurrentVersion(boolean currentVersion) {
+ this.currentVersion = currentVersion;
+ }
+ public String getDetails() {
+ return details;
+ }
+ public void setDetails(String details) {
+ this.details = details;
+ }
+ public Long getId() {
+ return id;
+ }
+ public void setId(Long id) {
+ this.id = id;
+ }
+ public Master getMaster() {
+ return master;
+ }
+ public void setMaster(Master master) {
+ this.master = master;
+ }
+ public int getVersion() {
+ return version;
+ }
+ public void setVersion(int version) {
+ this.version = version;
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/formulajoin/Master.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/formulajoin/Master.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/formulajoin/Master.hbm.xml 2007-07-17
16:33:24 UTC (rev 2479)
@@ -0,0 +1,65 @@
+<?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 use of an association "filtered" using a formula
+ mapping in the foreign key.
+
+-->
+
+<hibernate-mapping package="mapping.formulajoin">
+
+ <class name="Master" table="t_masters">
+
+ <id name="id">
+ <generator class="increment"/>
+ </id>
+
+ <property name="name"
+ not-null="true"
+ length="100"
+ update="false"/>
+
+ <many-to-one name="detail"
+ property-ref="currentMaster"
+ insert="false"
+ update="false">
+ <column name="id"/>
+ <formula>1</formula>
+ </many-to-one>
+
+ </class>
+
+ <class name="Detail" table="t_details">
+
+ <id name="id">
+ <generator class="hilo"/>
+ </id>
+
+ <property name="details"
+ length="300"
+ update="false"
+ not-null="true"/>
+
+ <property name="version" update="false">
+ <column name="version"
+ not-null="true"
+ unique-key="masterVersion"/>
+ </property>
+
+ <properties name="currentMaster">
+ <many-to-one name="master">
+ <column name="cur_master"
+ unique-key="masterVersion"
+ not-null="true"/>
+ </many-to-one>
+ <property name="currentVersion"
+ not-null="true"/>
+ </properties>
+
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/formulajoin/Master.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/formulajoin/Master.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/formulajoin/Master.java 2007-07-17
16:33:24 UTC (rev 2479)
@@ -0,0 +1,31 @@
+//$Id: Master.java 4602 2004-09-26 11:42:47Z oneovthafew $
+package mapping.formulajoin;
+
+import java.io.Serializable;
+
+/**
+ * @author Gavin King
+ */
+public class Master implements Serializable {
+ private Long id;
+ private String name;
+ private Detail detail;
+ public Detail getDetail() {
+ return detail;
+ }
+ public void setDetail(Detail detail) {
+ this.detail = detail;
+ }
+ 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;
+ }
+}
Show replies by date