In spring social is it possible to persist posts to the database with Hibernate directly ? Or will have to manually copy the Spring social Post object into my own Post entity and then persist it ?
Thanks in advance.
In spring social is it possible to persist posts to the database with Hibernate directly ? Or will have to manually copy the Spring social Post object into my own Post entity and then persist it ?
Thanks in advance.
Last edited by cmr; Feb 11th, 2013 at 05:26 AM.
It's your custom logic, so Social Spring won't persist Post entity, it's obvious imho.
Best regards.
Blandger answered your question accurately. Spring Social does *nothing* to help you persist posts or any other thing you may fetch via its API bindings. Doing so is well outside of the scope of the framework. But once you have a post or any other data, you are free to do whatever you want with it, including persisting it to a database.
I do advise you to review the terms of use for whatever API you are wanting to persist data for, however. Some of them expressly state that you should not keep local copies of any data that you receive from their API (aside from anything that can be reasonably described as caching). While there's nothing technical stopping you from persisting anything you fetch, you may be in violation of the terms of use if you do persist that data.
Craig Walls
Spring Social Project Lead
That's interesting that they might have a term that dis-allows you from saving.
But I guess it might be because they want to own all that data. Or as protection of a rogue application stealing too personal data.
Mark
Thanks for that valuable advice, that saved me a lot of future headaches. You guys were right ... can't save posts to database but can cache them.