示例#1
0
 /**
  * Retrieve the repository (if defined) for a particular domain class.
  *
  * @param <T> the type of the object that will be returned
  * @param <Z> the type of domain class.
  * @param entityClass the {@link SchemaClass} of domain class.
  * @return the repository instance.
  */
 public static <T extends GenericRepository<?>> T repository(SchemaClass entityClass) {
   if (entityClass != null) {
     String repositoryName = entityClass.getName() + "Repository";
     return Roma.autoComponent(repositoryName);
   }
   return null;
 }
示例#2
0
 /**
  * returns a domain factory (if defined) for a particular schema class.
  *
  * @param <T> the type of the object that will be returned
  * @param entityClass the {@link SchemaClass} of the domain class
  * @return a domain factory (if defined) for a particular schema class
  */
 public static <T extends GenericFactory<?>> T factory(SchemaClass entityClass) {
   String factoryName = entityClass.getName() + "Factory";
   return autoComponent(factoryName);
 }