private <P extends BaseProxy> SimpleProxyId<P> createId(Class<P> clazz, String serverId) { SimpleProxyId<P> toReturn; if (isValueType(clazz)) { toReturn = new SimpleProxyId<P>(clazz, serverId); } else { @SuppressWarnings("unchecked") SimpleProxyId<P> temp = (SimpleProxyId<P>) new SimpleEntityProxyId<EntityProxy>( asEntityProxy(clazz), serverId); toReturn = (SimpleProxyId<P>) temp; } return toReturn; }
/** * EntityProxies are equal if they are from the same RequestContext and their * stableIds are equal. */ public static boolean equals(AutoBean<? extends EntityProxy> bean, Object o) { if (!(o instanceof EntityProxy)) { return false; } AutoBean<EntityProxy> other = AutoBeanUtils.getAutoBean((EntityProxy) o); if (other == null) { // Unexpected, could be an user-provided implementation? return false; } // Object comparison intentional. True if both null or both the same return stableId(bean).equals(stableId(other)) && nonDiffingRequestContext(bean) == nonDiffingRequestContext(other); }
/** * Hashcode is always that of the stableId, since it's stable across time. */ public static int hashCode(AutoBean<? extends EntityProxy> bean) { return stableId(bean).hashCode(); }
public <P extends EntityProxy> Request<P> find(EntityProxyId<P> proxyId) { if (((SimpleEntityProxyId<P>) proxyId).isEphemeral()) { throw new IllegalArgumentException("Cannot fetch unpersisted entity"); } AbstractRequestContext context = new AbstractRequestContext(AbstractRequestFactory.this, AbstractRequestContext.Dialect.STANDARD) { @Override protected AutoBeanFactory getAutoBeanFactory() { return AbstractRequestFactory.this.getAutoBeanFactory(); } }; return context.find(proxyId); }
public <P extends EntityProxy> Request<P> find(EntityProxyId<P> proxyId) { if (((SimpleEntityProxyId<P>) proxyId).isEphemeral()) { throw new IllegalArgumentException("Cannot fetch unpersisted entity"); } AbstractRequestContext context = new AbstractRequestContext(AbstractRequestFactory.this, AbstractRequestContext.Dialect.STANDARD) { @Override protected AutoBeanFactory getAutoBeanFactory() { return AbstractRequestFactory.this.getAutoBeanFactory(); } }; return context.find(proxyId); }
private <P extends BaseProxy> SimpleProxyId<P> createId(Class<P> clazz, int clientId) { SimpleProxyId<P> toReturn; if (isValueType(clazz)) { toReturn = new SimpleProxyId<P>(clazz, clientId); } else { @SuppressWarnings("unchecked") SimpleProxyId<P> temp = (SimpleProxyId<P>) new SimpleEntityProxyId<EntityProxy>( asEntityProxy(clazz), clientId); toReturn = (SimpleProxyId<P>) temp; } return toReturn; }
/** * Hashcode is always that of the stableId, since it's stable across time. */ public static int hashCode(AutoBean<? extends EntityProxy> bean) { return stableId(bean).hashCode(); }
public <P extends EntityProxy> Request<P> find(EntityProxyId<P> proxyId) { if (((SimpleEntityProxyId<P>) proxyId).isEphemeral()) { throw new IllegalArgumentException("Cannot fetch unpersisted entity"); } AbstractRequestContext context = new AbstractRequestContext(AbstractRequestFactory.this, AbstractRequestContext.Dialect.STANDARD) { @Override protected AutoBeanFactory getAutoBeanFactory() { return AbstractRequestFactory.this.getAutoBeanFactory(); } }; return context.find(proxyId); }
/** * EntityProxies are equal if they are from the same RequestContext and their * stableIds are equal. */ public static boolean equals(AutoBean<? extends EntityProxy> bean, Object o) { if (!(o instanceof EntityProxy)) { return false; } AutoBean<EntityProxy> other = AutoBeanUtils.getAutoBean((EntityProxy) o); if (other == null) { // Unexpected, could be an user-provided implementation? return false; } // Object comparison intentional. True if both null or both the same return stableId(bean).equals(stableId(other)) && nonDiffingRequestContext(bean) == nonDiffingRequestContext(other); }
private <P extends BaseProxy> SimpleProxyId<P> createId(Class<P> clazz, String serverId) { SimpleProxyId<P> toReturn; if (isValueType(clazz)) { toReturn = new SimpleProxyId<P>(clazz, serverId); } else { @SuppressWarnings("unchecked") SimpleProxyId<P> temp = (SimpleProxyId<P>) new SimpleEntityProxyId<EntityProxy>( asEntityProxy(clazz), serverId); toReturn = (SimpleProxyId<P>) temp; } return toReturn; }
/** * Hashcode is always that of the stableId, since it's stable across time. */ public static int hashCode(AutoBean<? extends EntityProxy> bean) { return stableId(bean).hashCode(); }
public <P extends EntityProxy> Request<P> find(EntityProxyId<P> proxyId) { if (((SimpleEntityProxyId<P>) proxyId).isEphemeral()) { throw new IllegalArgumentException("Cannot fetch unpersisted entity"); } AbstractRequestContext context = new AbstractRequestContext(AbstractRequestFactory.this, AbstractRequestContext.Dialect.STANDARD) { @Override protected AutoBeanFactory getAutoBeanFactory() { return AbstractRequestFactory.this.getAutoBeanFactory(); } }; return context.find(proxyId); }
/** * EntityProxies are equal if they are from the same RequestContext and their * stableIds are equal. */ public static boolean equals(AutoBean<? extends EntityProxy> bean, Object o) { if (!(o instanceof EntityProxy)) { return false; } AutoBean<EntityProxy> other = AutoBeanUtils.getAutoBean((EntityProxy) o); if (other == null) { // Unexpected, could be an user-provided implementation? return false; } // Object comparison intentional. True if both null or both the same return stableId(bean).equals(stableId(other)) && nonDiffingRequestContext(bean) == nonDiffingRequestContext(other); }
private <P extends BaseProxy> SimpleProxyId<P> createId(Class<P> clazz, int clientId) { SimpleProxyId<P> toReturn; if (isValueType(clazz)) { toReturn = new SimpleProxyId<P>(clazz, clientId); } else { @SuppressWarnings("unchecked") SimpleProxyId<P> temp = (SimpleProxyId<P>) new SimpleEntityProxyId<EntityProxy>( asEntityProxy(clazz), clientId); toReturn = (SimpleProxyId<P>) temp; } return toReturn; }
/** * Hashcode is always that of the stableId, since it's stable across time. */ public static int hashCode(AutoBean<? extends EntityProxy> bean) { return stableId(bean).hashCode(); }
/** * EntityProxies are equal if they are from the same RequestContext and their * stableIds are equal. */ public static boolean equals(AutoBean<? extends EntityProxy> bean, Object o) { if (!(o instanceof EntityProxy)) { return false; } AutoBean<EntityProxy> other = AutoBeanUtils.getAutoBean((EntityProxy) o); if (other == null) { // Unexpected, could be an user-provided implementation? return false; } // Object comparison intentional. True if both null or both the same return stableId(bean).equals(stableId(other)) && nonDiffingRequestContext(bean) == nonDiffingRequestContext(other); }
private <P extends BaseProxy> SimpleProxyId<P> createId(Class<P> clazz, int clientId) { SimpleProxyId<P> toReturn; if (isValueType(clazz)) { toReturn = new SimpleProxyId<P>(clazz, clientId); } else { @SuppressWarnings("unchecked") SimpleProxyId<P> temp = (SimpleProxyId<P>) new SimpleEntityProxyId<EntityProxy>( asEntityProxy(clazz), clientId); toReturn = (SimpleProxyId<P>) temp; } return toReturn; }
private <P extends BaseProxy> SimpleProxyId<P> createId(Class<P> clazz, String serverId) { SimpleProxyId<P> toReturn; if (isValueType(clazz)) { toReturn = new SimpleProxyId<P>(clazz, serverId); } else { @SuppressWarnings("unchecked") SimpleProxyId<P> temp = (SimpleProxyId<P>) new SimpleEntityProxyId<EntityProxy>( asEntityProxy(clazz), serverId); toReturn = (SimpleProxyId<P>) temp; } return toReturn; }
private <P extends BaseProxy> SimpleProxyId<P> createId(Class<P> clazz, String serverId) { SimpleProxyId<P> toReturn; if (isValueType(clazz)) { toReturn = new SimpleProxyId<P>(clazz, serverId); } else { @SuppressWarnings("unchecked") SimpleProxyId<P> temp = (SimpleProxyId<P>) new SimpleEntityProxyId<EntityProxy>( asEntityProxy(clazz), serverId); toReturn = (SimpleProxyId<P>) temp; } return toReturn; }
private <P extends BaseProxy> SimpleProxyId<P> createId(Class<P> clazz, int clientId) { SimpleProxyId<P> toReturn; if (isValueType(clazz)) { toReturn = new SimpleProxyId<P>(clazz, clientId); } else { @SuppressWarnings("unchecked") SimpleProxyId<P> temp = (SimpleProxyId<P>) new SimpleEntityProxyId<EntityProxy>( asEntityProxy(clazz), clientId); toReturn = (SimpleProxyId<P>) temp; } return toReturn; }