Package com.alpha.mongodb.entitymanager
Class ManagedEntityEnhancer
- java.lang.Object
-
- com.alpha.mongodb.entitymanager.ManagedEntityEnhancer
-
public class ManagedEntityEnhancer extends Object
Entity Enhancer that creates proxy entities and adds functionalities like `refresh`, `update` based on the interfaces, the entity implements from.- Author:
- Shashank Sharma
-
-
Constructor Summary
Constructors Constructor Description ManagedEntityEnhancer(ManagedMongoTemplate mongoTemplate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tenhance(T entity)Enhances an existingManageableentity by providing a proxy implementation for all the manageable methodsstatic <T> Tenhance(T entity, ManagedMongoTemplate mongoTemplate)Static implementation that enhances an existingManageableentity by providing a proxy implementation for all the manageable methodsstatic <T> Tenhance(T entity, ManagedMongoTemplate mongoTemplate, String collectionName)Static implementation that enhances an existingManageableentity by providing a proxy implementation for all the manageable methods<T> Tenhance(T entity, String collectionName)Enhances an existingManageableentity by providing a proxy implementation for all the manageable methods<T extends Manageable>
TnewEntity(Class<T> tClass)Creates a new entity of type `tClass`
-
-
-
Constructor Detail
-
ManagedEntityEnhancer
public ManagedEntityEnhancer(ManagedMongoTemplate mongoTemplate)
-
-
Method Detail
-
newEntity
public <T extends Manageable> T newEntity(Class<T> tClass)
Creates a new entity of type `tClass`- Type Parameters:
T- type- Parameters:
tClass- the type of the object to be created- Returns:
- an enhanced entity of type T
-
enhance
public <T> T enhance(T entity)
Enhances an existingManageableentity by providing a proxy implementation for all the manageable methods- Type Parameters:
T- type- Parameters:
entity- the entity to be enhanced- Returns:
- an enhanced entity of type T
-
enhance
public <T> T enhance(T entity, String collectionName)Enhances an existingManageableentity by providing a proxy implementation for all the manageable methods- Type Parameters:
T- type- Parameters:
entity- entity to be enhancedcollectionName- collection name- Returns:
- an enhanced entity of type T
-
enhance
public static <T> T enhance(T entity, ManagedMongoTemplate mongoTemplate)Static implementation that enhances an existingManageableentity by providing a proxy implementation for all the manageable methods- Type Parameters:
T- type- Parameters:
entity- entity to be enhancedmongoTemplate- Mongo template- Returns:
- enhanced entity of type T
-
enhance
public static <T> T enhance(T entity, ManagedMongoTemplate mongoTemplate, String collectionName)Static implementation that enhances an existingManageableentity by providing a proxy implementation for all the manageable methods- Type Parameters:
T- type- Parameters:
entity- entity to be enhancedmongoTemplate- Mongo template- Returns:
- enhanced entity of type T
-
-