From 18f6c465fc9ca404b9c4513b0566f535f19f9eb9 Mon Sep 17 00:00:00 2001 From: Nikita Date: Fri, 23 Dec 2016 12:14:40 +0300 Subject: [PATCH] deprecated methods removed --- .../redisson/RedissonLiveObjectService.java | 29 ------------------- .../org/redisson/api/RLiveObjectService.java | 22 -------------- 2 files changed, 51 deletions(-) diff --git a/redisson/src/main/java/org/redisson/RedissonLiveObjectService.java b/redisson/src/main/java/org/redisson/RedissonLiveObjectService.java index 250e77003..92a83e3d0 100644 --- a/redisson/src/main/java/org/redisson/RedissonLiveObjectService.java +++ b/redisson/src/main/java/org/redisson/RedissonLiveObjectService.java @@ -110,23 +110,6 @@ public class RedissonLiveObjectService implements RLiveObjectService { return ClassUtils.getField(proxied, "liveObjectLiveMap"); } - @Override - public T create(Class entityClass) { - validateClass(entityClass); - try { - Class proxyClass = getProxyClass(entityClass); - Object id = generateId(entityClass); - T proxied = instantiateLiveObject(proxyClass, id); - if (!getMap(proxied).fastPut("redisson_live_object", "1")) { - throw new IllegalArgumentException("Object already exists"); - } - return proxied; - } catch (Exception ex) { - unregisterClass(entityClass); - throw ex instanceof RuntimeException ? (RuntimeException) ex : new RuntimeException(ex); - } - } - private Object generateId(Class entityClass) throws NoSuchFieldException { String idFieldName = getRIdFieldName(entityClass); RId annotation = entityClass @@ -149,18 +132,6 @@ public class RedissonLiveObjectService implements RLiveObjectService { } } - @Override - public T getOrCreate(Class entityClass, K id) { - try { - T proxied = instantiateLiveObject(getProxyClass(entityClass), id); - getMap(proxied).fastPut("redisson_live_object", "1"); - return proxied; - } catch (Exception ex) { - unregisterClass(entityClass); - throw ex instanceof RuntimeException ? (RuntimeException) ex : new RuntimeException(ex); - } - } - @Override public T attach(T detachedObject) { validateDetached(detachedObject); diff --git a/redisson/src/main/java/org/redisson/api/RLiveObjectService.java b/redisson/src/main/java/org/redisson/api/RLiveObjectService.java index de0078c3b..db91ffb7c 100644 --- a/redisson/src/main/java/org/redisson/api/RLiveObjectService.java +++ b/redisson/src/main/java/org/redisson/api/RLiveObjectService.java @@ -26,16 +26,6 @@ package org.redisson.api; */ public interface RLiveObjectService { - /** - * Use {@link #persist(Object)} method instead - * - * @param entityClass Entity class - * @param Entity type - * @return Always returns a proxied object. Even it does not exist in redis. - */ - @Deprecated - T create(Class entityClass); - /** * Finds the entity from Redis with the id. * @@ -57,18 +47,6 @@ public interface RLiveObjectService { */ T get(Class entityClass, K id); - /** - * Use {@link #persist(Object)} method instead - * - * @param entityClass Entity class - * @param id identifier - * @param Entity type - * @param Key type - * @return Always returns a proxied object. Even it does not exist in redis. - */ - @Deprecated - T getOrCreate(Class entityClass, K id); - /** * Returns proxied object for the detached object. Discard all the * field values already in the detached instance.