{
+ /**
+ * Obtains the PersistentEntity for this class mapping
+ *
+ * @return The PersistentEntity
+ */
+ PersistentEntity getEntity();
+
+ /**
+ * Returns the mapped form of the class such as a Table, a Key Space, Document etc.
+ *
+ * @return The mapped representation
+ */
+ T getMappedForm();
+
+ /**
+ * Returns details of the identifier used for this class
+ *
+ * @return The Identity
+ */
+ IdentityMapping getIdentifier();
+}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/DatastoreConfigurationException.java b/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/DatastoreConfigurationException.java
new file mode 100644
index 000000000..b27406168
--- /dev/null
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/DatastoreConfigurationException.java
@@ -0,0 +1,18 @@
+package org.springframework.data.mapping.model;
+
+/**
+ * Exception thrown when something goes wrong configuring a datastore
+ *
+ * @author Graeme Rocher
+ * @since 1.0
+ */
+public class DatastoreConfigurationException extends RuntimeException{
+
+ public DatastoreConfigurationException(String message) {
+ super(message);
+ }
+
+ public DatastoreConfigurationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/EntityInstantiationException.java b/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/EntityInstantiationException.java
new file mode 100644
index 000000000..c3b368a19
--- /dev/null
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/EntityInstantiationException.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 EntityInstantiationException extends RuntimeException {
+ public EntityInstantiationException(String s, Throwable throwable) {
+ super(s, throwable);
+ }
+}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/IdentityMapping.java b/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/IdentityMapping.java
new file mode 100644
index 000000000..851ab3ccd
--- /dev/null
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/IdentityMapping.java
@@ -0,0 +1,31 @@
+/* Copyright (C) 2010 SpringSource
+ *
+ * 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 Graeme Rocher
+ * @since 1.0
+ */
+public interface IdentityMapping extends PropertyMapping{
+
+ /**
+ * The identifier property name(s) as an array. Usually there is just one identifier
+ * name, however in the case of a composite or natural identifier there
+ * may be serveral names
+ *
+ * @return A String[] of identifier names that make up the key
+ */
+ String[] getIdentifierName();
+}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/IllegalMappingException.java b/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/IllegalMappingException.java
new file mode 100644
index 000000000..035583cb1
--- /dev/null
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/IllegalMappingException.java
@@ -0,0 +1,28 @@
+/* Copyright (C) 2010 SpringSource
+ *
+ * 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;
+
+/**
+ * Thrown when an error occurs reading the mapping between object and datastore
+ *
+ * @author Graeme Rocher
+ * @since 1.0
+ */
+public class IllegalMappingException extends RuntimeException {
+
+ public IllegalMappingException(String s) {
+ super(s);
+ }
+}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/MappingConfigurationStrategy.java b/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/MappingConfigurationStrategy.java
new file mode 100644
index 000000000..ca6ab7485
--- /dev/null
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mapping/model/MappingConfigurationStrategy.java
@@ -0,0 +1,70 @@
+package org.springframework.data.mapping.model;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * This interface defines a strategy for reading how
+ * persistent properties are defined in a persistent entity.
+ *
+ * Subclasses can implement this interface in order to provide
+ * a different mechanism for mapping entities such as annotations or XML.
+ *
+ * @author Graeme Rocher
+ * @since 1.0
+ */
+public interface MappingConfigurationStrategy {
+
+ /**
+ * Tests whether the given class is a persistent entity
+ *
+ * @param javaClass The java class
+ * @return true if it is a persistent entity
+ */
+ boolean isPersistentEntity(Class javaClass);
+
+ /**
+ * @see #getPersistentProperties(Class, MappingContext, ClassMapping)
+ */
+ List