java - Disable enhancement for Play Framework model classes -
Is there a way to disable play framework model classes? The reason for this is that I am asking because I want to serial model object in JSON, but as soon as the JSON serializer touches any non-inhalational model, that model will be launched due to an additional database hit and its As a result, Jason will be flooded with unnecessary model objects, I call this code serverConfig.addClass (Model.class)
with the model. *
and ServerConfigStartup
have tried to leave it. Call serverConfig.addPackage ("Model")
but none of them work for me
EBI requires that the model class be extended If you are not expanding then you can not use model class with EBI.
So, you have options, do not use EBI, or do not sort your model objects in JSON. The latter is considered to be the best practice, it is not a good idea to bind your rest data data object to your database models, due to this problem now which you are experiencing - both models are generally different - the database model There are other references to models, while the JSON model does not. Then use different sections to represent different models.
Another option is to use Jackson annotations such as @JasonEngor to ignore these properties, but in reality, it is a slippery slope, because your codebase is developed, it is impossible for you to Looks like JSON, as you start using more of these annotations in your classes, and keep the models, to ensure that you can not break your public comfort API, a misery Dream becomes.
Comments
Post a Comment