package {packName};

import org.springframework.stereotype.Component;

import com.eyu.common.ramcache.anno.Inject;
import com.eyu.common.ramcache.service.EntityBuilder;
import com.eyu.common.ramcache.service.EntityCacheService;
/**
 * {name}实体管理
 * @author {author}
 */
@Component
public class {moduleName}Manager {

	@Inject
	private EntityCacheService<Long, {moduleName}> cacheService;

	public {moduleName} loadOrCreate(long playerId) {
		{moduleName} entity = cacheService.loadOrCreate(playerId, new EntityBuilder<Long, {moduleName}>() {
			@Override
			public {moduleName} newInstance(Long playerId) {
				return {moduleName}.valueOf(playerId);
			}
		});
		return entity;
	}

}
