I am trying to use @Transient (javax.persistence.Transient) in one of my entity, it works fine for inserting the records (the Transient fields are not stored in DB which is OK) but when I am trying to update the same entity the Transient fields also gets stored into mongodb.
I am using Play2.2, mongo-java-driver, MongoJack and MongoDB for my application.
Please help me.
Thanks in advance.
javax.persistence.Transient (@Transient) is not working with MongoDB while updating
1.2k Views Asked by Parag Vaidya At
2
There are 2 best solutions below
0
Jeach
On
In case you are looking for the actual package like I was, this one will work:
import org.springframework.data.annotation.Transient;
Which is from the Spring framework API documentation.
But this one, which is a JPA annotation, will not work for Spring Data's MongoDB:
import javax.persistence.Transient;
Which is part of the Java Persistence API.
Related Questions in MONGODB
- Meteor MapReduce Package Error: A method named is already defined
- Token based authorization in nodejs/ExpressJs and Angular(Single Page Application)
- Big data with spatial queries/indexing
- How to recover from losing all your /data/db
- What are the benefits of using the fields option when querying in Meteor
- Node JS Async Response
- mongoose get property from nested schema after `group`
- What to use for subdocuments ID's in MongoDB?
- ORM Code First versa Database First in Production
- How to profile a Yii2 based API?
- get length of embedded document in mongoDB with jade
- Architecture: Multiple Mongo databases+connections vs multiple collections with Express
- Why are numbers being inserted into MongoDB incorrectly?
- hibernate ogm mongo db, how to get count of collection?
- C++ Mongodb driver, not working
Related Questions in PLAYFRAMEWORK-2.0
- Play Framework Unable to build entity manager factory when Working with PostGIS
- Play Framework Basic Auth User Not Changing Between Sessions
- How to keep Akka running all the time in Play 2.3
- Play Scala Framework Error
- Play Scala activator compile command shows value userid is not a member of play.api.data.Form[models.Changepas sword]
- Java - Getting the URL's parameter
- Faking Ajax Request Form for testing
- missing arguments for method apply... Play Framework 2.4 compilation error
- Return boolean from async request play framework scala
- Error while deploying play web app into azure cloud
- Play 2.4.0 https support - RSA no longer available?
- Play Scala 2.4 linking asynchronous calls
- Language selector in Play 2.4 & Scala 2.11.6
- Dynamic Filter Building in Elasticsearch
- Advanced HTTP server configurations in Play 2.3
Related Questions in MONGO-JAVA
- Can not connector to replica set with Java driver, works with Node.js driver
- How to find objects between two date ranges in mongodb
- java code gives error in mongodb while compiling
- partially update fields in a document - findAndModify remove all other fields?
- Is write operations go to secondary when i set readpreference as secondary in mongodb?
- Bson pretty print using Java MongoDb driver
- Error 11000 in Mongo Java, DuplicateKeyException
- Executing Mongo like Query (JSON)through Java
- Getting nested Document from mongo db using java Driver
- How to specify Multiple conditions in Java Mongo
- Mongo/Java findAndReplace not working
- mongo + java + too many open files
- Sorting in distinct data
- Checking array type before unwind
- Exception determining maxBSONObjectSize/connection refused because too many open connections using Mule Mongo Connector
Related Questions in MONGO-JACKSON-MAPPER
- mongojack: Unrecognized field at subclass
- How to deserialize this dynamic keys JSON to Java custom Pojo using Jackson
- object mapper conversion issue when string contains'\/' patterns
- How can I deserialize a nested wrapped String in Jackson?
- How to append new value to a list in mongodb?
- What is the JacksonDB equivalent of db.collection.find({},{"fieldName":1})?
- find set of records in mongodb/jackson driver user a List of ids?
- is this query a valid mongo jackson mapper query?
- MongoJack MongoDB Scala Optional ObjectId Not Working
- Jackson - Wrapping a list of objects with root object
- How to use Jackson ObjectMapper to parse json response to java objects
- Execute mongoDB shell like query using a java class
- Extract specific field from json and deserialize it according to speicific Class<?>
- Jackson ignore attribute on sub class that is 3:d party
- Serialize one class in two different ways with Jackson
Related Questions in MONGOJACK
- MongoJack with java.time
- How to insert Date object with the latest mongojack?
- Mongojack: invalid hexadecimal representation of an ObjectId
- MongoDriver UUID Support
- MongoJack with Kotlin
- Dropwizard returns 400 on valid GET
- MongoJack MongoDB Scala Optional ObjectId Not Working
- MongoDB average value of attribute of embedded array (using Java and MongoJack)
- MongoJack support @javax.persistance.Id doesn't work
- How to use elemmatch in in mongojack in Java
- Use of MongoJack and updateById
- MongoDB - MongoJack find and remove
- Mongodb cursor.toArray() is too slow
- "com.fasterxml.jackson.databind.JsonMappingException: Expected type float, integer, or string." converting the java.time.Instant with ObjectMapper
- Cannot deserialize localdatetime using mongo and mongojack
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Use
@JsonIgnore(from com.fasterxml.jackson.annotation).