Examples of SimpleValue


Examples of org.hibernate.metamodel.relational.SimpleValue

    hasSequentialSelects = hasDeferred;

    // DISCRIMINATOR

    if ( entityBinding.isPolymorphic() ) {
      SimpleValue discriminatorRelationalValue = entityBinding.getHierarchyDetails().getEntityDiscriminator().getBoundValue();
      if ( discriminatorRelationalValue == null ) {
        throw new MappingException("discriminator mapping required for single table polymorphic persistence");
      }
      forceDiscriminator = entityBinding.getHierarchyDetails().getEntityDiscriminator().isForced();
      if ( DerivedValue.class.isInstance( discriminatorRelationalValue ) ) {
View Full Code Here

Examples of org.jboss.metatype.api.values.SimpleValue

    }
   
    MetaType type = v1.getMetaType();
    if (v1 instanceof SimpleValue && type instanceof SimpleMetaType) {
      SimpleMetaType st = (SimpleMetaType)type;
      SimpleValue sv = wrap(st, v2);
      return sv.compareTo((SimpleValue)v1) == 0;
    }
    return false;
  }
View Full Code Here

Examples of org.jboss.metatype.api.values.SimpleValue

 
  public static String stringValue(MetaValue v1) {
    if (v1 != null) {
      MetaType type = v1.getMetaType();
      if (type instanceof SimpleMetaType) {
        SimpleValue simple = (SimpleValue)v1;
        return simple.getValue().toString();
      }
      throw new TeiidRuntimeException("Failed to convert value to string value"); //$NON-NLS-1$
    }
    return null;
 
View Full Code Here

Examples of org.jboss.metatype.api.values.SimpleValue

  public static <T> T getSimpleValue(ManagedCommon mc, String prop, Class<T> expectedType) {
     ManagedProperty mp = mc.getProperty(prop);
     if (mp != null) {
       MetaType metaType = mp.getMetaType();
       if (metaType.isSimple()) {
                SimpleValue simpleValue = (SimpleValue)mp.getValue();
                return expectedType.cast((simpleValue != null) ? simpleValue.getValue() : null);
       }
       else if (metaType.isEnum()) {
         EnumValue enumValue = (EnumValue)mp.getValue();
         return expectedType.cast((enumValue != null) ? enumValue.getValue() : null);
       }
View Full Code Here

Examples of org.jboss.metatype.api.values.SimpleValue

       MetaType metaType = mp.getMetaType();
       if (metaType.isCollection()) {
         CollectionValue collectionValue = (CollectionValue)mp.getValue();
         for(MetaValue value:collectionValue.getElements()) {
           if (value.getMetaType().isSimple()) {
             SimpleValue simpleValue = (SimpleValue)value;
             list.add(expectedType.cast(simpleValue.getValue()));
           }
           else {
             throw new IllegalArgumentException(prop+ " is not a simple type"); //$NON-NLS-1$
           }
         }
View Full Code Here

Examples of org.jboss.metatype.api.values.SimpleValue

            {
                MetaType metaType = managedProp.getMetaType();
                Object value;
                if (metaType.isSimple())
                {
                    SimpleValue simpleValue = (SimpleValue)managedProp.getValue();
                    value = simpleValue.getValue();
                }
                else if (metaType.isEnum())
                {
                    EnumValue enumValue = (EnumValue)managedProp.getValue();
                    value = enumValue.getValue();
View Full Code Here

Examples of org.jboss.metatype.api.values.SimpleValue

        propSimple.setValue(value);
    }

    public MetaValue convertToMetaValue(PropertySimple propSimple, PropertyDefinitionSimple propDefSimple, MetaType metaType)
    {
        SimpleValue simpleValue = new SimpleValueSupport((SimpleMetaType)metaType, null);
        populateMetaValueFromProperty(propSimple, simpleValue, propDefSimple);
        return simpleValue;
    }
View Full Code Here

Examples of org.jboss.metatype.api.values.SimpleValue

  public static String stringValue(MetaValue v1) throws Exception {
    if (v1 != null) {
      MetaType type = v1.getMetaType();
      if (type instanceof SimpleMetaType) {
        SimpleValue simple = (SimpleValue) v1;
        return simple.getValue().toString();
      }
      throw new Exception("Failed to convert value to string value"); //$NON-NLS-1$
    }
    return null;
  }
View Full Code Here

Examples of org.jboss.metatype.api.values.SimpleValue

  public static Boolean booleanValue(MetaValue v1) throws Exception {
    if (v1 != null) {
      MetaType type = v1.getMetaType();
      if (type instanceof SimpleMetaType) {
        SimpleValue simple = (SimpleValue) v1;
        return Boolean.valueOf(simple.getValue().toString());
      }
      throw new Exception("Failed to convert value to boolean value"); //$NON-NLS-1$
    }
    return null;
  }
View Full Code Here

Examples of org.jboss.metatype.api.values.SimpleValue

  public static Double doubleValue(MetaValue v1) throws Exception {
    if (v1 != null) {
      MetaType type = v1.getMetaType();
      if (type instanceof SimpleMetaType) {
        SimpleValue simple = (SimpleValue) v1;
        return Double.valueOf(simple.getValue().toString());
      }
      throw new Exception("Failed to convert value to double value"); //$NON-NLS-1$
    }
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.