Ejemplo n.º 1
0
 private Comparable extractViaPortable(String attributeName, Data data) {
   try {
     return PortableExtractor.extractValue(serializationService, data, attributeName);
   } catch (QueryException e) {
     throw e;
   } catch (Exception e) {
     throw new QueryException(e);
   }
 }
Ejemplo n.º 2
0
  @Override
  public AttributeType getAttributeType(String attributeName) {
    if (KEY_ATTRIBUTE_NAME.equals(attributeName)) {
      return ReflectionHelper.getAttributeType(getKey().getClass());
    } else if (THIS_ATTRIBUTE_NAME.equals(attributeName)) {
      return ReflectionHelper.getAttributeType(getValue().getClass());
    }

    boolean isKey = isKey(attributeName);
    attributeName = getAttributeName(isKey, attributeName);
    Data data = getOptionalTargetData(isKey);

    if (data != null && data.isPortable()) {
      PortableContext portableContext = serializationService.getPortableContext();
      return PortableExtractor.getAttributeType(portableContext, data, attributeName);
    }
    return ReflectionHelper.getAttributeType(isKey ? getKey() : getValue(), attributeName);
  }