javadocs added

pull/1283/head
Nikita 7 years ago
parent d7ec3a4ea3
commit 8606051205

@ -16,16 +16,36 @@
package org.redisson.api;
/**
* Live Object cascade type.
*
* @author Nikita Koksharov
*
*/
public enum RCascadeType {
/**
* Includes all cascade types.
*/
ALL,
/**
* Cascade persist operation during {@link RLiveObjectService#persist} method invocation.
*/
PERSIST,
/**
* Cascade detach operation during {@link RLiveObjectService#detach} method invocation.
*/
DETACH,
/**
* Cascade merge operation during {@link RLiveObjectService#merge} method invocation.
*/
MERGE,
/**
* Cascade delete operation during {@link RLiveObjectService#delete} method invocation.
*/
DELETE

@ -23,6 +23,7 @@ import java.lang.annotation.Target;
import org.redisson.api.RCascadeType;
/**
* Specifies that the defined cascade types are applied to the object/objects contained in Live Object field.
*
* @author Nikita Koksharov
*
@ -31,6 +32,9 @@ import org.redisson.api.RCascadeType;
@Target({ElementType.FIELD})
public @interface RCascade {
/**
* List of applied cascade types.
*/
RCascadeType[] value();
}

@ -25,6 +25,7 @@ import org.redisson.client.codec.Codec;
import org.redisson.codec.JsonJacksonCodec;
/**
* Specifies that the class is a Live Object.
*
* @author Rui Gu (https://github.com/jackygurui)
*/
@ -33,13 +34,28 @@ import org.redisson.codec.JsonJacksonCodec;
public @interface REntity {
public enum TransformationMode {
IMPLEMENTATION_BASED, ANNOTATION_BASED
IMPLEMENTATION_BASED,
ANNOTATION_BASED
}
/**
* (Optional) Live Object naming scheme. Defines how to assign key names for each instance of this class.
* Used to create a reference to an existing Live Object and materialising a new one in redis.
* Defaults to {@link DefaultNamingScheme} implementation.
*/
Class<? extends NamingScheme> namingScheme() default DefaultNamingScheme.class;
/**
* (Optional) Live Object state codec. Defaults to {@link JsonJacksonCodec}.
*/
Class<? extends Codec> codec() default JsonJacksonCodec.class;
/**
* (Optional) Live Object field transformation.
* Defaults to {@link TransformationMode#ANNOTATION_BASED}
*/
TransformationMode fieldTransformation() default TransformationMode.ANNOTATION_BASED;
}

@ -21,6 +21,19 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Specifies that the method is a field accessor for Live Object.
* Example:
* <pre>
* &#064;RFieldAccessor
* public <T> void set(String field, T value) {
* }
*
* &#064;RFieldAccessor
* public <T> T get(String field) {
* return null;
* }
* </pre>
*
*
* @author Rui Gu (https://github.com/jackygurui)
*/

@ -20,10 +20,14 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.redisson.liveobject.resolver.LongGenerator;
import org.redisson.liveobject.resolver.RIdResolver;
import org.redisson.liveobject.resolver.RequiredIdResolver;
import org.redisson.liveobject.resolver.UUIDGenerator;
/**
* Specifies that the field is a Live Object's id field.
* Only single field could be specified per class.
*
* @author Rui Gu (https://github.com/jackygurui)
*/
@ -31,6 +35,12 @@ import org.redisson.liveobject.resolver.RequiredIdResolver;
@Target({ElementType.FIELD})
public @interface RId {
/**
* (Optional) Live Object id generator. By default id is required to be fill during object creation.
*
* @see UUIDGenerator
* @see LongGenerator
*/
Class<? extends RIdResolver> generator() default RequiredIdResolver.class;
}

@ -21,6 +21,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Specifies that the field value is filled up with RedissonClient instance.
*
* @author Nikita Koksharov
*

@ -25,6 +25,11 @@ import org.redisson.client.codec.Codec;
import org.redisson.codec.JsonJacksonCodec;
/**
* By default <code>namingScheme</code> and/or <code>codec</code> parameters specified in {@link REntity}
* are applied for each Live Object field.
*
* This annotation allows to specify custom <code>namingScheme</code> and/or <code>codec</code> parameters
* for any Live Object field except that marked with {@link RId}.
*
* @author Rui Gu (https://github.com/jackygurui)
*/
@ -32,8 +37,16 @@ import org.redisson.codec.JsonJacksonCodec;
@Target({ElementType.FIELD})
public @interface RObjectField{
/**
* (Optional) Live Object naming scheme. Defines how to assign key names for each instance of this class.
* Used to create a reference to an existing Live Object and materialising a new one in redis.
* Defaults to {@link DefaultNamingScheme} implementation.
*/
Class<? extends NamingScheme> namingScheme() default DefaultNamingScheme.class;
/**
* (Optional) Live Object state codec. Defaults to {@link JsonJacksonCodec}.
*/
Class<? extends Codec> codec() default JsonJacksonCodec.class;
}

Loading…
Cancel
Save