Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static <T> T findAndRestore(Class<T> clazz, Long id) throws Exception {
- T securedObject = SecuredEntityUtils.getObjectFromSecuredTable(clazz, id);
- T entity = Ebean.find(clazz, id);
- if (securedObject != null) {
- if (entity == null) {
- Ebean.save(securedObject);
- } else if (!entity.equals(securedObject)) {
- Ebean.update(securedObject);
- }
- } else {
- logger.warn("Not found securedObject for entity : " + entity.getClass());
- }
- return securedObject ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement