Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src')
-rw-r--r--examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/META-INF/orm-small.xml80
-rw-r--r--examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/META-INF/orm.xml301
-rw-r--r--examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/META-INF/persistence.xml29
-rw-r--r--examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/LibraryCustomizer.java49
-rw-r--r--examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/MapEntryId.java67
-rw-r--r--examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/PublisherCustomizer.java37
-rw-r--r--examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/TypeWriterCustomizer.java29
-rw-r--r--examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/TypeWriterEnumConverter.java53
-rw-r--r--examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/WriterCustomizer.java67
9 files changed, 0 insertions, 712 deletions
diff --git a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/META-INF/orm-small.xml b/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/META-INF/orm-small.xml
deleted file mode 100644
index 356819f7f..000000000
--- a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/META-INF/orm-small.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<entity-mappings version="1.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm ../../orm_1_0.xsd ">
-
- <!--=================================-->
- <!-- Persistence unit level metadata -->
- <!--=================================-->
-
- <persistence-unit-metadata>
- <xml-mapping-metadata-complete/>
- <persistence-unit-defaults>
- <access>FIELD</access>
- </persistence-unit-defaults>
- </persistence-unit-metadata>
-
- <!--=============================-->
- <!-- Mapping file level metadata -->
- <!--=============================-->
-
- <package>org.eclipse.emf.teneo.eclipselink.examples.library.impl</package>
-
- <!--=========-->
- <!-- Queries -->
- <!--=========-->
-
-
- <!--=========================-->
- <!-- Abstract class mappings -->
- <!--=========================-->
-
- <!--=================-->
- <!-- Entity mappings -->
- <!--=================-->
-
- <entity name="Publisher" class="PublisherImpl">
- <table name="EMFLIB_PUBLISHER"/>
- <attributes>
- <id name="dbID">
- <column name="ID"/>
- <generated-value/>
- </id>
- <basic name="name"/>
- <many-to-many name="writers" target-entity="WriterImpl">
- <join-table name="PUBLISHER_WRITER"></join-table>
- <cascade>
- <cascade-persist/>
- <cascade-merge/>
- <cascade-refresh/>
- </cascade>
- </many-to-many>
- </attributes>
- </entity>
-
- <entity name="Writer" class="WriterImpl">
- <table name="EMFLIB_WRITER"/>
- <attributes>
- <id name="dbID">
- <column name="ID"/>
- <generated-value/>
- </id>
- <basic name="name"/>
- <basic name="eContainerFeatureID">
- <column name="ECONT_FEAT_ID"/>
- </basic>
- <many-to-many name="publishers" target-entity="PublisherImpl" mapped-by="writers">
- <cascade>
- <cascade-persist/>
- <cascade-merge/>
- <cascade-refresh/>
- </cascade>
- </many-to-many>
- <transient name="typewriters"/>
- <transient name="books" />
- <transient name="address" />
- <transient name="eContainer" />
- </attributes>
- </entity>
-
-</entity-mappings> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/META-INF/orm.xml b/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/META-INF/orm.xml
deleted file mode 100644
index 046b9e841..000000000
--- a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/META-INF/orm.xml
+++ /dev/null
@@ -1,301 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<entity-mappings
- xmlns="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
- version="1.0">
-
- <!--=================================-->
- <!-- Persistence unit level metadata -->
- <!--=================================-->
-
- <persistence-unit-metadata>
- <xml-mapping-metadata-complete/>
- <persistence-unit-defaults>
- <access>FIELD</access>
- </persistence-unit-defaults>
- </persistence-unit-metadata>
-
- <!--=============================-->
- <!-- Mapping file level metadata -->
- <!--=============================-->
-
- <package>org.eclipse.emf.teneo.eclipselink.examples.library.impl</package>
-
- <!--=========-->
- <!-- Queries -->
- <!--=========-->
-
-
- <!--=========================-->
- <!-- Abstract class mappings -->
- <!--=========================-->
-
- <!--=================-->
- <!-- Entity mappings -->
- <!--=================-->
-
- <entity name="Address" class="AddressImpl">
- <table name="EMFLIB_ADDRESS"/>
- <attributes>
- <id name="dbID">
- <column name="ID"/>
- <generated-value/>
- </id>
- <basic name="town"/>
- <basic name="eContainerFeatureID">
- <column name="ECONT_FEAT_ID"/>
- </basic>
- <one-to-one name="eContainer" target-entity="WriterImpl" mapped-by="address">
- </one-to-one>
- </attributes>
- </entity>
-
- <entity name="Book" class="BookImpl" access="FIELD">
- <table name="EMFLIB_BOOK"/>
- <attributes>
- <id name="dbID">
- <column name="ID"/>
- <generated-value/>
- </id>
- <basic name="title"/>
- <basic name="pages"/>
- <basic name="eContainerFeatureID">
- <column name="ECONT_FEAT_ID"/>
- </basic>
- <many-to-one name="author" target-entity="WriterImpl">
- <join-column name="AUTHOR_ID"/>
- <cascade>
- <cascade-persist/>
- <cascade-merge/>
- <cascade-refresh/>
- </cascade>
- </many-to-one>
- <one-to-many name="styles" target-entity="BookStylesMapEntryImpl" mapped-by="eContainer">
- <cascade>
- <cascade-all/>
- </cascade>
- </one-to-many>
- <one-to-one name="cover" target-entity="CoverImpl" mapped-by="eContainer">
- <cascade>
- <cascade-all/>
- </cascade>
- </one-to-one>
- <one-to-one name="eContainer" target-entity="StringToBookMapEntryImpl" mapped-by="value">
- <cascade>
- <cascade-all/>
- </cascade>
- </one-to-one>
- <one-to-one name="translator" target-entity="TranslatorImpl">
- <join-column name="TRANSLATOR_ID"/>
- <cascade>
- <cascade-persist/>
- <cascade-merge/>
- <cascade-refresh/>
- </cascade>
- </one-to-one>
- <!-- TODO: category requires conversion/transformation/enum -->
- <transient name="category"/>
- </attributes>
- </entity>
-
- <entity class="BookStylesMapEntryImpl">
- <table name="EMFLIB_BOOK_STYLE_MAP"/>
- <id-class class="org.eclipse.emf.teneo.eclipselink.examples.library.orm.MapEntryId"/>
- <attributes>
- <id name="key">
- <column name="MAPKEY"/>
- </id>
- <id name="dbID">
- <column name="BOOK_ID" updatable="false" insertable="false"/>
- </id>
- <basic name="eContainerFeatureID">
- <column name="ECONT_FEAT_ID"/>
- </basic>
- <one-to-one name="value" target-entity="StyleImpl">
- <join-column name="STYLE_ID"/>
- <cascade>
- <cascade-persist/>
- <cascade-merge/>
- <cascade-refresh/>
- </cascade>
- </one-to-one>
- <one-to-one name="eContainer" target-entity="BookImpl">
- <join-column name="BOOK_ID"/>
- </one-to-one>
- <transient name="hash"/>
- </attributes>
- </entity>
-
- <entity name="Cover" class="CoverImpl">
- <table name="EMFLIB_COVER"/>
- <attributes>
- <id name="dbID">
- <column name="ID"/>
- <generated-value/>
- </id>
- <basic name="colored"/>
- <basic name="eContainerFeatureID">
- <column name="ECONT_FEAT_ID"/>
- </basic>
- <one-to-one name="eContainer" target-entity="BookImpl">
- <join-column name="ECONTAINER_ID"/>
- </one-to-one>
- </attributes>
- </entity>
-
- <entity name="Library" class="LibraryImpl">
- <table name="EMFLIB_LIBRARY"/>
- <attributes>
- <id name="dbID">
- <column name="ID"/>
- <generated-value/>
- </id>
- <basic name="name"/>
- <one-to-many name="books" target-entity="StringToBookMapEntryImpl" mapped-by="eContainer">
- <cascade>
- <cascade-all/>
- </cascade>
- </one-to-many>
- <one-to-many name="writers" target-entity="WriterImpl" mapped-by="eContainer">
- <cascade>
- <cascade-persist/>
- <cascade-merge/>
- <cascade-refresh/>
- </cascade>
- </one-to-many>
- </attributes>
- </entity>
-
- <entity name="Publisher" class="PublisherImpl">
- <table name="EMFLIB_PUBLISHER"/>
- <attributes>
- <id name="dbID">
- <column name="ID"/>
- <generated-value/>
- </id>
- <basic name="name"/>
- <many-to-many name="writers" target-entity="WriterImpl">
- <join-table name="EMFLIB_PUBLISHER_WRITER"></join-table>
- <cascade>
- <cascade-persist/>
- <cascade-merge/>
- <cascade-refresh/>
- </cascade>
- </many-to-many>
- </attributes>
- </entity>
-
- <entity class="StringToBookMapEntryImpl">
- <table name="EMFLIB_LIBRARY_BOOK_MAP"/>
- <id-class class="org.eclipse.emf.teneo.eclipselink.examples.library.orm.MapEntryId"/>
- <attributes>
- <id name="key">
- <column name="MAPKEY"/>
- </id>
- <id name="dbID">
- <column name="LIBRARY_ID" updatable="false" insertable="false"/>
- </id>
- <basic name="eContainerFeatureID">
- <column name="ECONT_FEAT_ID"/>
- </basic>
- <one-to-one name="value" target-entity="BookImpl">
- <join-column name="BOOK_ID" referenced-column-name="ID"/>
- <cascade>
- <cascade-persist/>
- <cascade-merge/>
- <cascade-refresh/>
- </cascade>
- </one-to-one>
- <one-to-one name="eContainer" target-entity="LibraryImpl">
- <join-column name="LIBRARY_ID"/>
- </one-to-one>
- <transient name="hash"/>
- </attributes>
- </entity>
-
- <entity name="Style" class="StyleImpl">
- <table name="EMFLIB_STYLE"/>
- <attributes>
- <id name="dbID">
- <column name="ID"/>
- <generated-value/>
- </id>
- <basic name="name"/>
- </attributes>
- </entity>
-
- <entity name="Translator" class="TranslatorImpl">
- <table name="EMFLIB_TRANSLATOR"/>
- <attributes>
- <id name="dbID">
- <column name="ID"/>
- <generated-value/>
- </id>
- <basic name="location"/>
- <basic name="name"/>
- <!-- address should be removed from Translator -->
- <transient name="address"/>
- </attributes>
- </entity>
-
- <entity name="TypeWriter" class="TypeWriterImpl">
- <table name="EMFLIB_TYPEWRITER"/>
- <attributes>
- <id name="dbID">
- <column name="ID"/>
- <generated-value/>
- </id>
- <basic name="maker"/>
- <basic name="type">
- <enumerated>STRING</enumerated>
- </basic>
- </attributes>
- </entity>
-
- <entity name="Writer" class="WriterImpl">
- <table name="EMFLIB_WRITER"/>
- <attributes>
- <id name="dbID">
- <column name="ID"/>
- <generated-value/>
- </id>
- <basic name="name"/>
- <basic name="eContainerFeatureID">
- <column name="ECONT_FEAT_ID"/>
- </basic>
- <one-to-many name="books" mapped-by="author" target-entity="BookImpl">
- <cascade>
- <cascade-all/>
- </cascade>
- </one-to-many>
- <one-to-one name="address" target-entity="AddressImpl" >
- <join-column name="ADDRESS_ID"/>
- <cascade>
- <cascade-persist/>
- <cascade-merge/>
- <cascade-refresh/>
- </cascade>
- </one-to-one>
- <one-to-one name="eContainer" target-entity="LibraryImpl">
- <join-column name="ECONTAINER_ID"/>
- </one-to-one>
- <many-to-many name="publishers" target-entity="PublisherImpl" mapped-by="writers">
- <cascade>
- <cascade-persist/>
- <cascade-merge/>
- <cascade-refresh/>
- </cascade>
- </many-to-many>
- <many-to-many name="typewriters" target-entity="TypeWriterImpl">
- <join-table name="EMFLIB_WRITER_TYPEWRITER"/>
- <cascade>
- <cascade-persist/>
- <cascade-merge/>
- <cascade-refresh/>
- </cascade>
- </many-to-many>
- </attributes>
- </entity>
-
-</entity-mappings> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/META-INF/persistence.xml b/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/META-INF/persistence.xml
deleted file mode 100644
index a5c462355..000000000
--- a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/META-INF/persistence.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
- <persistence-unit name="library">
- <properties>
- <property name="eclipselink.session-name" value="library" />
-
- <property name="eclipselink.logging.level" value="FINE" />
- <property name="eclipselink.logging.timestamp" value="false" />
- <property name="eclipselink.logging.thread" value="false" />
- <property name="eclipselink.logging.session" value="false" />
- <property name="eclipselink.jdbc.bind-parameters" value="false"/>
-
- <property name="eclipselink.target-database" value="Derby"/>
- <property name="eclipselink.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
- <property name="eclipselink.jdbc.url" value="jdbc:derby://localhost:1527/teneo;create=true"/>
- <property name="eclipselink.jdbc.user" value="app"/>
- <property name="eclipselink.jdbc.password" value="app"/>
-
- <property name="eclipselink.session.customizer" value="org.eclipse.emf.teneo.eclipselink.EmfSessionCustomizer"/>
-
- <property name="eclipselink.jdbc.read-connections.min" value="1"/>
- <property name="eclipselink.jdbc.write-connections.min" value="1"/>
- <!-- Uncomment to create database schema
- <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
- <property name="eclipselink.ddl-generation.output-mode" value="database"/>
- -->
- </properties>
- </persistence-unit>
-</persistence>
diff --git a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/LibraryCustomizer.java b/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/LibraryCustomizer.java
deleted file mode 100644
index 5c51b8a59..000000000
--- a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/LibraryCustomizer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle and Geensys.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle and Geensys - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.teneo.eclipselink.examples.library.orm;
-
-import org.eclipse.persistence.config.DescriptorCustomizer;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.indirection.IndirectList;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-
-public class LibraryCustomizer implements DescriptorCustomizer {
-
- /**
- * <one-to-many name="books" target-entity="StringToBookMapEntryImpl" mapped-by="eContainer"/> <one-to-many
- * name="writers" target-entity="WriterImpl" mapped-by="eContainer"/>
- */
- public void customize(ClassDescriptor descriptor) throws Exception {
- OneToManyMapping booksMapping = new OneToManyMapping();
- booksMapping.setAttributeName("books");
- booksMapping
- .setReferenceClass(org.eclipse.emf.teneo.eclipselink.examples.library.impl.StringToBookMapEntryImpl.class);
- booksMapping.setCascadeMerge(true);
- booksMapping.setCascadePersist(true);
- booksMapping.setCascadeRefresh(true);
- booksMapping.useTransparentCollection();
- booksMapping.useCollectionClass(IndirectList.class);
- booksMapping.addTargetForeignKeyFieldName("EMFLIB_LIBRARY_BOOK_MAP.LIBRARY_ID", "EMFLIB_LIBRARY.ID");
- descriptor.addMapping(booksMapping);
-
- OneToManyMapping writersMapping = new OneToManyMapping();
- writersMapping.setAttributeName("writers");
- writersMapping.setReferenceClass(org.eclipse.emf.teneo.eclipselink.examples.library.impl.WriterImpl.class);
- writersMapping.setCascadeMerge(true);
- writersMapping.setCascadePersist(true);
- writersMapping.setCascadeRefresh(true);
- writersMapping.useTransparentCollection();
- writersMapping.useCollectionClass(IndirectList.class);
- writersMapping.addTargetForeignKeyFieldName("EMFLIB_WRITER.ECONTAINER_ID", "EMFLIB_LIBRARY.ID");
- descriptor.addMapping(writersMapping);
- }
-
-}
diff --git a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/MapEntryId.java b/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/MapEntryId.java
deleted file mode 100644
index aececd861..000000000
--- a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/MapEntryId.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle and Geensys.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle and Geensys - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.teneo.eclipselink.examples.library.orm;
-
-public class MapEntryId {
- private String key;
- private long dbID;
-
- public MapEntryId() {
- }
-
- public MapEntryId(String key, long dbID) {
- this.key = key;
- this.dbID = dbID;
- }
-
- public String getKey() {
- return key;
- }
-
- public long getDbID() {
- return dbID;
- }
-
- @Override
- public int hashCode() {
- final int PRIME = 31;
- int result = 1;
- result = PRIME * result + (int) (dbID ^ (dbID >>> 32));
- result = PRIME * result + ((key == null) ? 0 : key.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final MapEntryId other = (MapEntryId) obj;
- if (dbID != other.dbID) {
- return false;
- }
- if (key == null) {
- if (other.key != null) {
- return false;
- }
- } else if (!key.equals(other.key)) {
- return false;
- }
- return true;
- }
-
-} \ No newline at end of file
diff --git a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/PublisherCustomizer.java b/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/PublisherCustomizer.java
deleted file mode 100644
index a0102bbc5..000000000
--- a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/PublisherCustomizer.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle and Geensys.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle and Geensys - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.teneo.eclipselink.examples.library.orm;
-
-import org.eclipse.emf.teneo.eclipselink.examples.library.impl.WriterImpl;
-import org.eclipse.persistence.config.DescriptorCustomizer;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.indirection.IndirectList;
-import org.eclipse.persistence.mappings.ManyToManyMapping;
-
-public class PublisherCustomizer implements DescriptorCustomizer {
-
- /**
- * <many-to-many name="writers"></many-to-many>
- */
- public void customize(ClassDescriptor descriptor) throws Exception {
- ManyToManyMapping writersMapping = new ManyToManyMapping();
- writersMapping.setAttributeName("writers");
- writersMapping.setCascadeAll(true);
- writersMapping.setReferenceClass(WriterImpl.class);
- writersMapping.useTransparentCollection();
- writersMapping.useCollectionClass(IndirectList.class);
- writersMapping.setRelationTableName("EMFLIB_WRITER_PUBLISHER");
- writersMapping.addSourceRelationKeyFieldName("EMFLIB_WRITER_PUBLISHER.PUBLISHER_ID", "EMFLIB_PUBLISHER.ID");
- writersMapping.addTargetRelationKeyFieldName("EMFLIB_WRITER_PUBLISHER.WRITER_ID", "EMFLIB_WRITER.ID");
- descriptor.addMapping(writersMapping);
- }
-
-}
diff --git a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/TypeWriterCustomizer.java b/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/TypeWriterCustomizer.java
deleted file mode 100644
index af838eb64..000000000
--- a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/TypeWriterCustomizer.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle and Geensys.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle and Geensys - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.teneo.eclipselink.examples.library.orm;
-
-import org.eclipse.persistence.config.DescriptorCustomizer;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.mappings.converters.Converter;
-
-public class TypeWriterCustomizer implements DescriptorCustomizer {
-
- /**
- * Add customizer to translate between Enum and value.
- */
- public void customize(ClassDescriptor descriptor) throws Exception {
- DirectToFieldMapping typeMapping = (DirectToFieldMapping) descriptor.getMappingForAttributeName("type");
- Converter typeWriterEnumConverter = TypeWriterEnumConverter.getInstance();
- typeMapping.setConverter(typeWriterEnumConverter);
- }
-
-}
diff --git a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/TypeWriterEnumConverter.java b/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/TypeWriterEnumConverter.java
deleted file mode 100644
index 8c3ff8d63..000000000
--- a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/TypeWriterEnumConverter.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle and Geensys.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle and Geensys - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.teneo.eclipselink.examples.library.orm;
-
-import org.eclipse.emf.teneo.eclipselink.examples.library.TWriterType;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.mappings.converters.Converter;
-import org.eclipse.persistence.sessions.Session;
-
-/*
- * TypeWriterEnumConverter is a singleton since it has no state.
- */
-@SuppressWarnings("serial")
-public class TypeWriterEnumConverter implements Converter {
- protected static TypeWriterEnumConverter instance = new TypeWriterEnumConverter();
-
- private TypeWriterEnumConverter() {
- }
-
- public static TypeWriterEnumConverter getInstance() {
- return instance;
- }
-
- public Object convertDataValueToObjectValue(Object data, Session session) {
- String typeName = (String) data;
- return TWriterType.get(typeName);
- }
-
- public Object convertObjectValueToDataValue(Object object, Session session) {
- TWriterType type = (TWriterType) object;
- if (type != null) {
- return type.getName();
- } else {
- return null;
- }
- }
-
- public void initialize(DatabaseMapping arg0, Session arg1) {
- }
-
- public boolean isMutable() {
- return false;
- }
-
-}
diff --git a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/WriterCustomizer.java b/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/WriterCustomizer.java
deleted file mode 100644
index cb154b902..000000000
--- a/examples/org.eclipse.emf.teneo.eclipselink.examples.library.orm/src/org/eclipse/emf/teneo/eclipselink/examples/library/orm/WriterCustomizer.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle and Geensys.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle and Geensys - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.teneo.eclipselink.examples.library.orm;
-
-import org.eclipse.emf.teneo.eclipselink.examples.library.impl.BookImpl;
-import org.eclipse.emf.teneo.eclipselink.examples.library.impl.PublisherImpl;
-import org.eclipse.emf.teneo.eclipselink.examples.library.impl.TypeWriterImpl;
-import org.eclipse.persistence.config.DescriptorCustomizer;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.indirection.IndirectList;
-import org.eclipse.persistence.mappings.ManyToManyMapping;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-
-public class WriterCustomizer implements DescriptorCustomizer {
-
- public void customize(ClassDescriptor descriptor) throws Exception {
-
- // <one-to-many name="books" mapped-by="author"/>
- OneToManyMapping booksMapping = new OneToManyMapping();
- booksMapping.setAttributeName("books");
- booksMapping.setReferenceClass(BookImpl.class);
- booksMapping.setCascadeMerge(true);
- booksMapping.setCascadeRefresh(true);
- booksMapping.setCascadeRemove(false);
- booksMapping.setCascadePersist(true);
-
- booksMapping.useTransparentCollection();
- booksMapping.useCollectionClass(IndirectList.class);
- booksMapping.addTargetForeignKeyFieldName("EMFLIB_BOOK.AUTHOR_ID", "EMFLIB_WRITER.ID");
- descriptor.addMapping(booksMapping);
-
- // <many-to-many name="publishers"></many-to-many>
- ManyToManyMapping publishersMapping = new ManyToManyMapping();
- publishersMapping.setIsReadOnly(true); // writable by "owner", Publisher
- publishersMapping.setAttributeName("publishers");
- publishersMapping.setReferenceClass(PublisherImpl.class);
- publishersMapping.useTransparentCollection();
- publishersMapping.useCollectionClass(IndirectList.class);
- publishersMapping.setRelationTableName("EMFLIB_WRITER_PUBLISHER");
- publishersMapping.addSourceRelationKeyFieldName("EMFLIB_WRITER_PUBLISHER.WRITER_ID", "EMFLIB_WRITER.ID");
- publishersMapping.addTargetRelationKeyFieldName("EMFLIB_WRITER_PUBLISHER.PUBLISHER_ID", "EMFLIB_PUBLISHER.ID");
- descriptor.addMapping(publishersMapping);
-
- // <many-to-many name="typewriters"></many-to-many>
- ManyToManyMapping typewritersMapping = new ManyToManyMapping();
- typewritersMapping.setAttributeName("typewriters");
- typewritersMapping.setReferenceClass(TypeWriterImpl.class);
- typewritersMapping.useTransparentCollection();
- typewritersMapping.useCollectionClass(IndirectList.class);
- typewritersMapping.setCascadeAll(true);
- typewritersMapping.setRelationTableName("EMFLIB_WRITER_TYPEWRITER");
- typewritersMapping.addSourceRelationKeyFieldName("EMFLIB_WRITER_TYPEWRITER.WRITER_ID", "EMFLIB_WRITER.ID");
- typewritersMapping.addTargetRelationKeyFieldName("EMFLIB_WRITER_TYPEWRITER.TYPEWRITER_ID",
- "EMFLIB_TYPEWRITER.ID");
- descriptor.addMapping(typewritersMapping);
-
- }
-
-}

Back to the top