-
Notifications
You must be signed in to change notification settings - Fork 43
proxyentity
jwpttcg66 edited this page Apr 18, 2017
·
4 revisions
- MethodSaveProxy 类需要使用代理 会通过此注解,注入到代理对象的变化集合里
EntityProxyFactory entityProxyFactory = (EntityProxyFactory) classPathXmlApplicationContext.getBean("entityProxyFactory");
MoreOrder moreOrder = new MoreOrder();
MoreOrder proxyOrder = entityProxyFactory.createProxyEntity(moreOrder);
@EntitySave
@DbMapper(mapper = OrderMapper.class)
public class Order extends BaseLongIDEntity implements RedisInterface, AsyncSave {
@FieldSave
private String status;
/**
* @return status
*/
public String getStatus() {
return status;
}
/**
* @param status
*/
@MethodSaveProxy(proxy="status")
public void setStatus(String status) {
this.status = status;
}
@Override
public String toString() {
return "Order{" +
"orderId=" + getId() +
", userId=" + getUserId() +
", status='" + status + '\'' +
'}';
}
@Override
public String getUnionKey() {
return String.valueOf(getUserId()+ EntityUtils.ENTITY_SPLIT_STRING + getId());
}
@Override
public String getRedisKeyEnumString() {
return RedisKeyEnum.PLAYER.getKey();
}
}