public <T> T getReference(Class<T> beanType, Object id) { return delegate.getReference(beanType, id); }
/** * Get a reference object. * <p> * This is sometimes described as a proxy (with lazy loading). * </p> * <pre>{@code * * Product product = Ebean.getReference(Product.class, 1); * * // You can get the id without causing a fetch/lazy load * Integer productId = product.getId(); * * // If you try to get any other property a fetch/lazy loading will occur * // This will cause a query to execute... * String name = product.getName(); * * }</pre> * * @param beanType the type of entity bean * @param id the id value */ public static <T> T getReference(Class<T> beanType, Object id) { return serverMgr.getDefaultServer().getReference(beanType, id); }
/** * Get a reference object. * <p> * This is sometimes described as a proxy (with lazy loading). * </p> * * <pre class="code"> * Product product = Ebean.getReference(Product.class, 1); * * // You can get the id without causing a fetch/lazy load * Integer productId = product.getId(); * * // If you try to get any other property a fetch/lazy loading will occur * // This will cause a query to execute... * String name = product.getName(); * </pre> * * @param beanType * the type of entity bean * @param id * the id value */ public static <T> T getReference(Class<T> beanType, Object id) { return serverMgr.getPrimaryServer().getReference(beanType, id); }
/** * Get a reference object. * <p> * This is sometimes described as a proxy (with lazy loading). * </p> * * <pre class="code"> * Product product = Ebean.getReference(Product.class, 1); * * // You can get the id without causing a fetch/lazy load * Integer productId = product.getId(); * * // If you try to get any other property a fetch/lazy loading will occur * // This will cause a query to execute... * String name = product.getName(); * </pre> * * @param beanType * the type of entity bean * @param id * the id value */ public static <T> T getReference(Class<T> beanType, Object id) { return serverMgr.getPrimaryServer().getReference(beanType, id); }
/** * Retrieves an entity reference for this ID. */ public T ref(I id) { return server().getReference(type, id); }
/** * Creates an entity reference for this ID. * <p> * Equivalent to {@link EbeanServer#getReference(Class, Object)} */ public T ref(I id) { return db().getReference(type, id); }