-
Apr 13th, 2011, 04:11 PM
#1
@Transient annotation being ignored - Spring MongoDB - 1.0.0.M2
Hi
I'm trying to use the @Transient annotation (org.springframework.data.annotation.Transient) to prevent a class property from being written to the database, but the value gets written anyway.
Is there a bug or am I doing something wrong?
Thanks in advance.
Derek
-
Apr 19th, 2011, 09:03 AM
#2
Hi,
Have you configured to use the MappingMongoConverter? See here for how.
Mark
-
May 1st, 2011, 07:59 AM
#3
Hi Mark
Thanks for the reply.
Sorry if I'm missing something obvious but how does that relate to this issue?
Derek
-
May 1st, 2011, 11:56 AM
#4
Annotation based mapping only works if you're using the MappingMongoConverter as backing converter for MongoTemplate. If you're not configuring the converter a SimpleMongoConverter will be used by default that simply serializes objects into Mongo without taking a look at any meta information whatsoever.
Cheers,
Ollie
-
May 1st, 2011, 02:25 PM
#5
Thanks Ollie, that works perfectly now.
Much appreciated.
Derek
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules