Browse Source
Added new attribute type-mapper-ref to the mapping-converter element in spring-mongo-1.3.xsd in order to support the configuration of custom-type-mappers. Removed the unsupported attributes "mongo-ref" and "mongo-template-ref" from the mapping-converter element in spring-mongo-1.3.xsd because they are not considered anymore. Updated MappingMongoConverterParser to be aware of the new attribute. Added examples for configuring a custom MongoTypeMapper the usage of @TypeAlias to the reference documentation. Original pull request: #61.pull/61/merge
10 changed files with 181 additions and 14 deletions
@ -0,0 +1,23 @@ |
|||||||
|
/* |
||||||
|
* Copyright 2013 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.mongodb.config; |
||||||
|
|
||||||
|
import org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Thomas Darimont |
||||||
|
*/ |
||||||
|
class CustomMongoTypeMapper extends DefaultMongoTypeMapper {} |
||||||
@ -0,0 +1,11 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xmlns:mongo="http://www.springframework.org/schema/data/mongo" |
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo.xsd |
||||||
|
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> |
||||||
|
|
||||||
|
<mongo:mapping-converter type-mapper-ref="customMongoTypeMapper"/> |
||||||
|
|
||||||
|
<bean name="customMongoTypeMapper" class="org.springframework.data.mongodb.config.CustomMongoTypeMapper"/> |
||||||
|
</beans> |
||||||
Loading…
Reference in new issue