Package org.geomajas.layer

Examples of org.geomajas.layer.LayerException


      if (transactionManager != null) {
        transactionManager.addIterator(it);
      }
      return fc.getBounds();
    } catch (Throwable t) {
      throw new LayerException(t, ExceptionCode.LAYER_MODEL_IO_EXCEPTION);
    }
  }
View Full Code Here


      if (transactionManager != null) {
        transactionManager.addIterator(it);
      }
      return new JavaIterator(it);
    } catch (Throwable t) {
      throw new LayerException(t, ExceptionCode.UNEXPECTED_PROBLEM);
    }
  }
View Full Code Here

    public Object getAttribute(String name) throws LayerException {
      try {
        return BeanUtils.getProperty(bean, name);
      } catch (Exception e) {
        throw new LayerException();
      }
    }
View Full Code Here

    if (featureInfo.getIdentifier().getName().equals(name)) {
      try {
        return dtoConverterService.toDto(entity == null ? null : entity.getAttribute(name),
            featureInfo.getIdentifier());
      } catch (GeomajasException e) {
        throw new LayerException(e, ExceptionCode.CONVERSION_PROBLEM);
      }
    }
    for (AttributeInfo attributeInfo : featureInfo.getAttributes()) {
      names.add(attributeInfo.getName());
      if (attributeInfo.getName().equals(name)) {
        if (attributeInfo instanceof AssociationAttributeInfo) {
          associationAttributeInfo = (AssociationAttributeInfo) attributeInfo;
        } else if (attributeInfo instanceof PrimitiveAttributeInfo) {
          // primitive, return the attribute
          PrimitiveAttributeInfo primitiveAttributeInfo = (PrimitiveAttributeInfo) attributeInfo;
          try {
            return dtoConverterService.toDto(entity == null ? null : entity.getAttribute(name),
                primitiveAttributeInfo);
          } catch (GeomajasException e) {
            throw new LayerException(e, ExceptionCode.CONVERSION_PROBLEM);
          }
        }
      }
    }
    // association attribute
    if (associationAttributeInfo == null) {
      throw new LayerException(ExceptionCode.ATTRIBUTE_UNKNOWN, name, names);
    } else if (path.length > 1) {
      // go deeper
      return getRecursiveAttribute(entity == null ? null : entity.getChild(name),
          associationAttributeInfo.getFeature(), Arrays.copyOfRange(path, 1, path.length));
    } else {
View Full Code Here

    FeatureInfo childInfo = associationAttributeInfo.getFeature();
    PrimitiveAttribute<?> id;
    try {
      id = (PrimitiveAttribute) dtoConverterService.toDto(entity.getId(idInfo.getName()), idInfo);
    } catch (GeomajasException e) {
      throw new LayerException(e, ExceptionCode.CONVERSION_PROBLEM);
    }
    Map<String, Attribute<?>> attributes = new HashMap<String, Attribute<?>>();
    for (AttributeInfo attributeInfo : childInfo.getAttributes()) {
      attributes.put(attributeInfo.getName(),
          getRecursiveAttribute(entity, childInfo, new String[] { attributeInfo.getName() }));
View Full Code Here

    return new HibernateEntity(dataSourceName, id);
  }

  public Entity asEntity(Object object) throws LayerException {
    if (object == null) {
      throw new LayerException(ExceptionCode.FEATURE_MODEL_PROBLEM);
    }
    return new HibernateEntity(object);
  }
View Full Code Here

        }
        String entityName = ct.getAssociatedEntityName((SessionFactoryImplementor) sessionFactory);
        ClassMetadata childMetadata = sessionFactory.getClassMetadata(entityName);
        return new HibernateEntityCollection(metadata, childMetadata, object, coll);
      } else {
        throw new LayerException(ExceptionCode.FEATURE_MODEL_PROBLEM);
      }
    }
View Full Code Here

  }

  public Object read(String featureId) throws LayerException {
    Object object = getFeature(featureId);
    if (object == null) {
      throw new LayerException(ExceptionCode.LAYER_MODEL_FEATURE_NOT_FOUND, featureId);
    }
    return object;
  }
View Full Code Here

 
  public Attribute getAttribute(Object feature, String name) throws LayerException {
    try {
      return entityMappingService.getAttribute(feature, getFeatureInfo(), entityMapper, name);
    } catch (GeomajasException e) {
      throw new LayerException(e);
    }
  }
View Full Code Here

          attribs.put(name, value);
        }
      }
      return attribs;
    } catch (Exception e) {
      throw new LayerException(e, ExceptionCode.HIBERNATE_ATTRIBUTE_ALL_GET_FAILED, feature);
    }
  }
View Full Code Here

TOP

Related Classes of org.geomajas.layer.LayerException

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.