+ */
+public class MappingConfigurationException extends Throwable {
+ public MappingConfigurationException(String s) {
+ super(s);
+ }
+
+ public MappingConfigurationException(String s, Throwable throwable) {
+ super(s, throwable);
+ }
+}
diff --git a/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/MappingContext.java b/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/MappingContext.java
new file mode 100644
index 000000000..0d49d5a89
--- /dev/null
+++ b/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/MappingContext.java
@@ -0,0 +1,131 @@
+/* Copyright 2004-2005 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.data.mapping.model;
+
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.core.convert.ConversionService;
+import org.springframework.core.convert.converter.Converter;
+import org.springframework.core.convert.converter.ConverterRegistry;
+import org.springframework.validation.Validator;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * This interface defines the overall context including all known
+ * PersistentEntity instances and methods to obtain instances on demand
+ *
+ * This interface is used internally to establish associations
+ * between entities and also at runtime to obtain entities by name
+ *
+ * The generic type parameters T & R are used to specify the
+ * mapped form of a class (example Table) and property (example Column) respectively.
+ *
+ *
+ * @author Graeme Rocher
+ * @since 1.0
+ */
+public interface MappingContext extends InitializingBean {
+
+
+ /**
+ * Obtains a list of PersistentEntity instances
+ *
+ * @return A list of PersistentEntity instances
+ */
+ Collection> getPersistentEntities();
+
+ /**
+ * Obtains a PersistentEntity by name
+ *
+ * @param name The name of the entity
+ * @return The entity or null
+ */
+ PersistentEntity> getPersistentEntity(String name);
+
+ PersistentEntity getPersistentEntity(Class type);
+
+ /**
+ * Adds a PersistentEntity instance
+ *
+ * @param type The Java class representing the entity
+ * @return The PersistentEntity instance
+ */
+ PersistentEntity addPersistentEntity(Class type);
+
+ /**
+ * Adds a validator to be used by the entity for validation
+ *
+ * @param entity The PersistentEntity
+ * @param validator The validator
+ */
+ void addEntityValidator(PersistentEntity> entity, Validator validator);
+
+ /**
+ * Add a converter used to convert property values to and from the datastore
+ *
+ * @param converter The converter to add
+ */
+ void addTypeConverter(Converter converter);
+
+ /**
+ * Obtains the ConversionService instance to use for type conversion
+ *
+ * @return The conversion service instance
+ */
+ ConversionService getConversionService();
+
+ /**
+ * Obtains the converter registry
+ *
+ * @return The converter registry used for type conversion
+ */
+ ConverterRegistry getConverterRegistry();
+
+ /**
+ * Obtains a validator for the given entity
+ *
+ * @param entity The entity
+ * @return A validator or null if none exists for the given entity
+ */
+ List getEntityValidators(PersistentEntity> entity);
+
+ MappingConfigurationBuilder getMappingConfigurationBuilder();
+
+ void setMappingConfigurationBuilder(MappingConfigurationBuilder builder);
+
+ /**
+ * Returns whether the specified value is a persistent entity
+ *
+ * @param value The value to check
+ * @return True if it is
+ */
+ boolean isPersistentEntity(Object value);
+
+ void addContextListener(Listener listener);
+
+ /**
+ * Listener interface to deal with newly-added persistent entities.
+ */
+ public interface Listener {
+ /**
+ * Handle this new entity, return true or false, depending on whether this listener should continue listening.
+ *
+ * @param entity
+ * @return 'true' to leave listener attached, 'false' to remove this listener
+ */
+ boolean persistentEntityAdded(PersistentEntity> entity);
+ }
+}
diff --git a/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/MappingException.java b/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/MappingException.java
new file mode 100644
index 000000000..20cb6864a
--- /dev/null
+++ b/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/MappingException.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2011 by the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.mapping.model;
+
+/**
+ * @author Jon Brisbin
+ */
+public class MappingException extends RuntimeException {
+ public MappingException(String s) {
+ super(s);
+ }
+
+ public MappingException(String s, Throwable throwable) {
+ super(s, throwable);
+ }
+}
diff --git a/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/MappingInstantiationException.java b/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/MappingInstantiationException.java
new file mode 100644
index 000000000..6b208cc7c
--- /dev/null
+++ b/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/MappingInstantiationException.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2011 by the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.mapping.model;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: jbrisbin
+ * Date: 2/25/11
+ * Time: 9:07 AM
+ * To change this template use File | Settings | File Templates.
+ */
+public class MappingInstantiationException extends RuntimeException {
+ public MappingInstantiationException(String s, Throwable throwable) {
+ super(s, throwable);
+ }
+}
diff --git a/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/PersistentEntity.java b/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/PersistentEntity.java
new file mode 100644
index 000000000..97dc0ab13
--- /dev/null
+++ b/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/PersistentEntity.java
@@ -0,0 +1,87 @@
+package org.springframework.data.mapping.model;
+
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.data.mapping.AssociationHandler;
+import org.springframework.data.mapping.PropertyHandler;
+
+import java.util.Collection;
+
+
+/**
+ * Represents a persistent entity
+ *
+ * @author Graeme Rocher
+ * @since 1.0
+ */
+public interface PersistentEntity extends InitializingBean {
+
+ /**
+ * The entity name including any package prefix
+ *
+ * @return The entity name
+ */
+ String getName();
+
+ PreferredConstructor getPreferredConstructor();
+
+ void setPreferredConstructor(PreferredConstructor constructor);
+
+ /**
+ * Returns the identity of the instance
+ *
+ * @return The identity
+ */
+ PersistentProperty> getIdProperty();
+
+ void setIdProperty(PersistentProperty> property);
+
+ /**
+ * A list of properties to be persisted
+ *
+ * @return A list of PersistentProperty instances
+ */
+ Collection> getPersistentProperties();
+
+ void addPersistentProperty(PersistentProperty> property);
+
+ /**
+ * A list of the associations for this entity. This is typically a subset of the list returned by {@link #getPersistentProperties()}
+ *
+ * @return A list of associations
+ */
+ Collection getAssociations();
+
+ void addAssociation(Association association);
+
+ /**
+ * Obtains a PersistentProperty instance by name
+ *
+ * @param name The name of the property
+ * @return The PersistentProperty or null if it doesn't exist
+ */
+ PersistentProperty> getPersistentProperty(String name);
+
+ /**
+ * @return The underlying Java class for this entity
+ */
+ Class getType();
+
+ /**
+ * A list of property names
+ *
+ * @return A List of strings
+ */
+ Collection getPersistentPropertyNames();
+
+ /**
+ * Obtains the MappingContext where this PersistentEntity is defined
+ *
+ * @return The MappingContext instance
+ */
+ MappingContext getMappingContext();
+
+ void doWithProperties(PropertyHandler handler);
+
+ void doWithAssociations(AssociationHandler handler);
+
+}
diff --git a/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/PersistentProperty.java b/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/PersistentProperty.java
new file mode 100644
index 000000000..500f33a31
--- /dev/null
+++ b/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/PersistentProperty.java
@@ -0,0 +1,52 @@
+package org.springframework.data.mapping.model;
+
+import org.springframework.beans.factory.annotation.Value;
+
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Field;
+
+/**
+ * @author Graeme Rocher
+ * @since 1.0
+ */
+public interface PersistentProperty {
+
+ Object getOwner();
+
+ void setOwner(Object owner);
+
+ /**
+ * The name of the property
+ *
+ * @return The property name
+ */
+ String getName();
+
+ /**
+ * The type of the property
+ *
+ * @return The property type
+ */
+ Class getType();
+
+ PropertyDescriptor getPropertyDescriptor();
+
+ Field getField();
+
+ Value getValueAnnotation();
+
+ boolean isTransient();
+
+ boolean isAssociation();
+
+ Association getAssociation();
+
+ void setAssociation(Association association);
+
+ boolean isCollection();
+
+ boolean isComplexType();
+
+ Class> getComponentType();
+
+}
diff --git a/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/PreferredConstructor.java b/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/PreferredConstructor.java
new file mode 100644
index 000000000..d66c6ee2f
--- /dev/null
+++ b/spring-data-commons-core/src/main/java/org/springframework/data/mapping/model/PreferredConstructor.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2011 by the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.mapping.model;
+
+import org.springframework.beans.factory.annotation.Value;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author Jon Brisbin
+ */
+public class PreferredConstructor {
+
+ protected Constructor constructor;
+ protected List parameters = new LinkedList();
+
+ public PreferredConstructor(Constructor constructor) {
+ this.constructor = constructor;
+ this.parameters = parameters;
+ }
+
+ public Constructor getConstructor() {
+ return constructor;
+ }
+
+ public List getParameters() {
+ return parameters;
+ }
+
+ public void addParameter(String name, Class> type, Annotation[] annotations) {
+ parameters.add(new Parameter(name, type, annotations));
+ }
+
+ public static class Parameter {
+ protected final String name;
+ protected final Class> type;
+ protected final Annotation[] annotations;
+ protected Value value;
+
+ public Parameter(String name, Class> type, Annotation[] annotations) {
+ this.name = name;
+ this.type = type;
+ this.annotations = annotations;
+ for (Annotation anno : annotations) {
+ if (anno.annotationType() == Value.class) {
+ this.value = (Value) anno;
+ break;
+ }
+ }
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Class> getType() {
+ return type;
+ }
+
+ public Annotation[] getAnnotations() {
+ return annotations;
+ }
+
+ public Value getValue() {
+ return value;
+ }
+ }
+
+ public static interface ParameterValueProvider {
+ Object getParameterValue(Parameter parameter);
+ }
+
+}
diff --git a/spring-data-commons-core/src/test/java/org/springframework/data/mapping/Child.java b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/Child.java
new file mode 100644
index 000000000..000c13bdc
--- /dev/null
+++ b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/Child.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2011 by the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.mapping;
+
+import org.springframework.data.annotation.Persistent;
+
+/**
+ * @author Jon Brisbin
+ */
+@Persistent
+public class Child extends PersonWithId {
+
+ public Child(Integer ssn, String firstName, String lastName) {
+ super(ssn, firstName, lastName);
+ }
+
+}
diff --git a/spring-data-commons-core/src/test/java/org/springframework/data/mapping/Document.java b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/Document.java
new file mode 100644
index 000000000..1810d4407
--- /dev/null
+++ b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/Document.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011 by the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.mapping;
+
+import org.springframework.data.annotation.Persistent;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author Jon Brisbin
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({
+ ElementType.TYPE,
+ ElementType.FIELD
+})
+@Persistent
+public @interface Document {
+}
diff --git a/spring-data-commons-core/src/test/java/org/springframework/data/mapping/MappingMetadataTests.java b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/MappingMetadataTests.java
new file mode 100644
index 000000000..5f736180a
--- /dev/null
+++ b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/MappingMetadataTests.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2011 by the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.mapping;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.data.mapping.model.Association;
+import org.springframework.data.mapping.model.PersistentEntity;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import static junit.framework.Assert.*;
+
+/**
+ * @author Jon Brisbin
+ */
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration("classpath:mapping.xml")
+public class MappingMetadataTests {
+
+ BasicMappingContext ctx;
+
+ @Before
+ public void setup() {
+ ctx = new BasicMappingContext();
+ }
+
+ @Test
+ public void testDoesRecognizePersistentEntities() {
+ boolean persistentEntity = ctx.isPersistentEntity(PersonNoId.class);
+ assertFalse(persistentEntity);
+
+ persistentEntity = ctx.isPersistentEntity(PersonPersistent.class);
+ assertTrue(persistentEntity);
+ }
+
+ @Test
+ public void testPojoWithId() {
+ PersistentEntity person = ctx.addPersistentEntity(PersonWithId.class);
+ assertNotNull(person.getIdProperty());
+ assertEquals(String.class, person.getIdProperty().getType());
+ }
+
+ @Test
+ public void testPojoWithoutId() {
+ PersistentEntity person = ctx.addPersistentEntity(PersonNoId.class);
+ assertNull(person.getIdProperty());
+ }
+
+ @Test
+ public void testAssociations() {
+ PersistentEntity person = ctx.addPersistentEntity(PersonWithChildren.class);
+ assertNotNull(person.getAssociations());
+
+ for (Association association : person.getAssociations()) {
+ assertEquals(Child.class, association.getInverse().getComponentType());
+ }
+ }
+
+ @Test
+ public void testDoesRecognizeDocumentEntities() {
+ // PersistentEntity person = ctx.addPersistentEntity(PersonDocument.class);
+ boolean persistentEntity = ctx.isPersistentEntity(PersonDocument.class);
+ assertTrue(persistentEntity);
+ }
+
+}
\ No newline at end of file
diff --git a/spring-data-commons-core/src/test/java/org/springframework/data/mapping/Person.java b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/Person.java
new file mode 100644
index 000000000..404536d5b
--- /dev/null
+++ b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/Person.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2011 by the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.mapping;
+
+/**
+ * @author Jon Brisbin
+ */
+public abstract class Person {
+
+ private Integer ssn;
+ private String firstName;
+ private String lastName;
+
+ protected Person(Integer ssn, String firstName, String lastName) {
+ this.ssn = ssn;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ }
+
+ public Integer getSsn() {
+ return ssn;
+ }
+
+ public void setSsn(Integer ssn) {
+ this.ssn = ssn;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+}
diff --git a/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonDocument.java b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonDocument.java
new file mode 100644
index 000000000..e8b0b0a4d
--- /dev/null
+++ b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonDocument.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2011 by the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.mapping;
+
+/**
+ * @author Jon Brisbin
+ */
+@Document
+public class PersonDocument extends Person {
+
+ public PersonDocument(Integer ssn, String firstName, String lastName) {
+ super(ssn, firstName, lastName);
+ }
+
+}
diff --git a/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonNoId.java b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonNoId.java
new file mode 100644
index 000000000..d193b4fcc
--- /dev/null
+++ b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonNoId.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2011 by the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.mapping;
+
+/**
+ * @author Jon Brisbin
+ */
+public class PersonNoId extends Person {
+
+ public PersonNoId(Integer ssn, String firstName, String lastName) {
+ super(ssn, firstName, lastName);
+ }
+
+}
diff --git a/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonPersistent.java b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonPersistent.java
new file mode 100644
index 000000000..992ee0f04
--- /dev/null
+++ b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonPersistent.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2011 by the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.mapping;
+
+import org.springframework.data.annotation.Persistent;
+
+/**
+ * @author Jon Brisbin
+ */
+@Persistent
+public class PersonPersistent extends PersonWithId {
+
+ public PersonPersistent(Integer ssn, String firstName, String lastName) {
+ super(ssn, firstName, lastName);
+ }
+
+}
diff --git a/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonWithChildren.java b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonWithChildren.java
new file mode 100644
index 000000000..b3cb4481f
--- /dev/null
+++ b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonWithChildren.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2011 by the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.mapping;
+
+import org.springframework.data.annotation.Reference;
+
+import java.util.List;
+
+/**
+ * @author Jon Brisbin
+ */
+public class PersonWithChildren extends Person {
+
+ @Reference
+ private List children;
+
+ public PersonWithChildren(Integer ssn, String firstName, String lastName) {
+ super(ssn, firstName, lastName);
+ }
+
+ public List getChildren() {
+ return children;
+ }
+
+ public void setChildren(List children) {
+ this.children = children;
+ }
+
+}
diff --git a/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonWithId.java b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonWithId.java
new file mode 100644
index 000000000..8fa88a5df
--- /dev/null
+++ b/spring-data-commons-core/src/test/java/org/springframework/data/mapping/PersonWithId.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2011 by the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.mapping;
+
+import org.springframework.data.annotation.Id;
+
+/**
+ * @author Jon Brisbin
+ */
+public class PersonWithId extends Person {
+
+ @Id
+ private String id;
+
+ public PersonWithId(Integer ssn, String firstName, String lastName) {
+ super(ssn, firstName, lastName);
+ }
+
+ public String getId() {
+ return id;
+ }
+
+}
diff --git a/spring-data-commons-core/src/test/resources/log4j.xml b/spring-data-commons-core/src/test/resources/log4j.xml
new file mode 100644
index 000000000..721aa73b8
--- /dev/null
+++ b/spring-data-commons-core/src/test/resources/log4j.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/spring-data-commons-core/src/test/resources/mapping.xml b/spring-data-commons-core/src/test/resources/mapping.xml
new file mode 100644
index 000000000..30d582a9b
--- /dev/null
+++ b/spring-data-commons-core/src/test/resources/mapping.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/spring-data-commons-core/template.mf b/spring-data-commons-core/template.mf
index af09e6b73..6f1dcb8fe 100644
--- a/spring-data-commons-core/template.mf
+++ b/spring-data-commons-core/template.mf
@@ -11,7 +11,11 @@ Import-Template:
org.springframework.context.*;version="[3.0.0, 4.0.0)",
org.springframework.dao.*;version="[3.0.0, 4.0.0)",
org.springframework.util.*;version="[3.0.0, 4.0.0)",
+ org.springframework.expression.*;version="[3.0.0, 4.0.0)",
+ org.springframework.expression.spel.standard.*;version="[3.0.0, 4.0.0)",
+ org.springframework.expression.spel.support.*;version="[3.0.0, 4.0.0)",
org.springframework.transaction.*;version="[3.0.0, 4.0.0)",
+ org.springframework.validation.*;version="[3.0.0, 4.0.0)",
org.springframework.data.core.*;version="[1.0.0, 2.0.0)",
org.springframework.data.persistence.*;version="[1.0.0, 2.0.0)",
org.aopalliance.*;version="[1.0.0, 2.0.0)";resolution:=optional,