deprecated methods removed

pull/748/head
Nikita 8 years ago
parent 49e0303fa3
commit 18f6c465fc

@ -110,23 +110,6 @@ public class RedissonLiveObjectService implements RLiveObjectService {
return ClassUtils.getField(proxied, "liveObjectLiveMap");
}
@Override
public <T> T create(Class<T> entityClass) {
validateClass(entityClass);
try {
Class<? extends T> 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 <T> Object generateId(Class<T> entityClass) throws NoSuchFieldException {
String idFieldName = getRIdFieldName(entityClass);
RId annotation = entityClass
@ -149,18 +132,6 @@ public class RedissonLiveObjectService implements RLiveObjectService {
}
}
@Override
public <T, K> T getOrCreate(Class<T> 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> T attach(T detachedObject) {
validateDetached(detachedObject);

@ -26,16 +26,6 @@ package org.redisson.api;
*/
public interface RLiveObjectService {
/**
* Use {@link #persist(Object)} method instead
*
* @param entityClass Entity class
* @param <T> Entity type
* @return Always returns a proxied object. Even it does not exist in redis.
*/
@Deprecated
<T> T create(Class<T> entityClass);
/**
* Finds the entity from Redis with the id.
*
@ -57,18 +47,6 @@ public interface RLiveObjectService {
*/
<T, K> T get(Class<T> entityClass, K id);
/**
* Use {@link #persist(Object)} method instead
*
* @param entityClass Entity class
* @param id identifier
* @param <T> Entity type
* @param <K> Key type
* @return Always returns a proxied object. Even it does not exist in redis.
*/
@Deprecated
<T, K> T getOrCreate(Class<T> entityClass, K id);
/**
* Returns proxied object for the detached object. Discard all the
* field values already in the detached instance.

Loading…
Cancel
Save