Added Contract Mapping File

Added Contract Mapping File
This commit is contained in:
Togepy95
2017-05-03 00:53:42 +02:00
parent b9d84e797b
commit 88c4b0b772
3 changed files with 39 additions and 11 deletions

View File

@ -1,12 +1,11 @@
#Fri Mar 18 13:14:09 GMT+01:00 2011 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6 org.eclipse.jdt.core.compiler.source=1.7
eclipse.preferences.version=1

View File

@ -40,12 +40,12 @@ public class ImmoService {
//GetAll EstateAgents from DB //GetAll EstateAgents from DB
session.beginTransaction(); session.beginTransaction();
List<?> l = session.createCriteria(Makler.class).list(); List<?> l = session.createCriteria(Makler.class).list();
List<Makler> l_makler = new ArrayList<>(l.size()); List<Makler> l_makler = new ArrayList<Makler>(l.size());
for (Object o : l) { for (Object o : l) {
l_makler.add((Makler) o); l_makler.add((Makler) o);
} }
System.out.println(l_makler.size()+" Makler gefunden."); System.out.println(l_makler.size()+" Makler gefunden.");
makler = new HashSet<>(l_makler); makler = new HashSet<Makler>(l_makler);
session.getTransaction().commit(); session.getTransaction().commit();
session.close(); session.close();
} }

View File

@ -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>
<class name="de.dis2013.data.Vertrag" table="contract" schema="VSISP12">
<id name="id" column="id">
<generator class="increment" />
</id>
<property name="vertragsnummer" type="integer" column="contractnumber" />
<property name="datum" type="date" column="date" />
<property name="ort" type="string" column="place" />
<many-to-one name="person" class="de.dis2013.data.Person" column="person" not-null="true" />
<joined-subclass name="de.dis2013.data.Kaufvertrag" table="purchasecontract" schema="VSISP12">
<key column="id"/>
<property name="anzahlRaten" type="integer" column="numberofinstallments" />
<property name="ratenzins" type="integer" column="interestrate" />
<many-to-one name="haus" class="de.dis2013.data.Haus" column="house" not-null="true" />
</joined-subclass>
<joined-subclass name="de.dis2013.data.Mietvertrag" table="tenancycontract" schema="VSISP12">
<key column="id"/>
<property name="mietbeginn" type="date" column="startdate" />
<property name="dauer" type="date" column="duration" />
<property name="nebenkosten" type="integer" column="additionalcosts" />
<many-to-one name="wohnung" class="de.dis2013.data.Wohnung" column="apartment" not-null="true" />
</joined-subclass>
</class>
</hibernate-mapping>