Package com.cosmo.orm.annotations

Examples of com.cosmo.orm.annotations.CormObject


    *
    * @throws InvalidMappingException
    */
   public void addGroup(Class<?> ormClass) throws InvalidMappingException
   {
      CormObject ct;
      CormObjectField cfg;
      FormFieldset group;

      // Comprueba que sea un objeto CORM
      ct = ormClass.getAnnotation(CormObject.class);
      if (ct == null)
      {
         throw new InvalidMappingException("No CormObject annotation detected on POJO class.");
      }

      // Obtiene las propiedades de la clase y las mapea al formulario
      this.name = ct.formName();

      // Obtiene la lista de campos y los mapea a un grupo
      group = new FormFieldset("");
      group.setTitle(ct.title());
      group.setDescription(ct.description());
      for (Method method : ormClass.getMethods())
      {
         cfg = method.getAnnotation(CormObjectField.class);

         if (cfg != null && !cfg.isAutogenerated())
View Full Code Here


    * @throws IllegalAccessException
    * @throws IllegalArgumentException
    */
   public void addGroup(Object data) throws InvalidMappingException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
   {
      CormObject ct;
      CormObjectField cfg;
      FormFieldset group;

      // Comprueba si el objeto proporcionado es un objeto CORM v�lido
      if (!OrmFactory.isValidCormObject(data.getClass()))
      {
         throw new InvalidMappingException(data.getClass() + " is not a CORM object.");
      }

      // Obtiene las propiedades de la clase y las mapea al formulario
      ct = data.getClass().getAnnotation(CormObject.class);
      this.name = ct.formName();

      // Obtiene la lista de campos y los mapea a un grupo
      group = new FormFieldset("");
      group.setTitle(ct.title());
      group.setDescription(ct.description());
      for (Method method : data.getClass().getMethods())
      {
         cfg = method.getAnnotation(CormObjectField.class);

         if (cfg != null && !cfg.isAutogenerated())
View Full Code Here

    *
    * @throws InvalidMappingException
    */
   public static String getDbTableName(Class<?> ormClass) throws InvalidMappingException
   {
      CormObject co = ormClass.getAnnotation(CormObject.class);
      if (co != null)
      {
         return co.dbTable();
      }

      throw new InvalidMappingException(ormClass.getName() + " is not a CORM object.");
   }
View Full Code Here

TOP

Related Classes of com.cosmo.orm.annotations.CormObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.