Package siena.core

Examples of siena.core.DecimalPrecision.storageType()


          else if (fieldClass == BigDecimal.class){
            DecimalPrecision ann = field.getAnnotation(DecimalPrecision.class);
            if(ann == null) {
              value = ((BigDecimal)value).toPlainString();
            }else {
              switch(ann.storageType()){
              case DOUBLE:
                value = ((BigDecimal)value).doubleValue();
                break;
              case STRING:
              case NATIVE:
View Full Code Here


      else if(f.getType() == BigDecimal.class){
        DecimalPrecision ann = f.getAnnotation(DecimalPrecision.class);
        if(ann == null) {
          value = new BigDecimal((String)value);
        }else {
          switch(ann.storageType()){
          case DOUBLE:
            value = BigDecimal.valueOf((Double)value);
            break;
          case STRING:
          case NATIVE:
View Full Code Here

        else if (fieldClass == BigDecimal.class){
          DecimalPrecision ann = f.getAnnotation(DecimalPrecision.class);
          if(ann == null) {
            propValue = ((BigDecimal)propValue).toPlainString();
          }else {
            switch(ann.storageType()){
            case DOUBLE:
              propValue = ((BigDecimal)propValue).doubleValue();
              break;
            case STRING:
            case NATIVE:
View Full Code Here

      else if (type == BigDecimal.class){
        DecimalPrecision ann = field.getAnnotation(DecimalPrecision.class);
        if(ann == null) {
          return ((BigDecimal)val).toPlainString();
        }else {
          switch(ann.storageType()){
          case DOUBLE:
            return ((Double)((BigDecimal)val).doubleValue()).toString();
          case STRING:
          case NATIVE:
            return ((BigDecimal)val).toPlainString();
View Full Code Here

        DecimalPrecision ann = field.getAnnotation(DecimalPrecision.class);
        if(ann == null) {
          Util.setField(obj, field, new BigDecimal((String)val));
          return;
        }else {
          switch(ann.storageType()){
          case DOUBLE:
            // TODO add bigdecimal double lexicographic storage
            Util.setField(obj, field, new BigDecimal(val));
            return;
          case STRING:
View Full Code Here

          else if(BigDecimal.class == type){
            DecimalPrecision ann = field.getAnnotation(DecimalPrecision.class);
            if(ann == null) {
              value = (BigDecimal)value;
            }else {
              switch(ann.storageType()){
              case DOUBLE:
                value = ((BigDecimal)value).doubleValue();
                break;
              case STRING:
                value = ((BigDecimal)value).toPlainString();
View Full Code Here

      if(an == null) {
        columnType = Types.DECIMAL;
        column.setSizeAndScale(19, 2);
      }
      else {
        if(an.storageType() == DecimalPrecision.StorageType.NATIVE){
          columnType = Types.DECIMAL;
          column.setSizeAndScale(an.size(), an.scale());
        }else if(an.storageType() == DecimalPrecision.StorageType.STRING) {
          columnType = Types.VARCHAR;
          // should be an.size+"."+sign
View Full Code Here

      }
      else {
        if(an.storageType() == DecimalPrecision.StorageType.NATIVE){
          columnType = Types.DECIMAL;
          column.setSizeAndScale(an.size(), an.scale());
        }else if(an.storageType() == DecimalPrecision.StorageType.STRING) {
          columnType = Types.VARCHAR;
          // should be an.size+"."+sign
          column.setSize((an.size()+2)+"");
        }else if(an.storageType() == DecimalPrecision.StorageType.DOUBLE) {
          columnType = Types.DOUBLE;         
View Full Code Here

          column.setSizeAndScale(an.size(), an.scale());
        }else if(an.storageType() == DecimalPrecision.StorageType.STRING) {
          columnType = Types.VARCHAR;
          // should be an.size+"."+sign
          column.setSize((an.size()+2)+"");
        }else if(an.storageType() == DecimalPrecision.StorageType.DOUBLE) {
          columnType = Types.DOUBLE;         
        }else {
          columnType = Types.DECIMAL;
          column.setSizeAndScale(19, 2);
        }
View Full Code Here

      DecimalPrecision an = field.getAnnotation(DecimalPrecision.class);
      if(an == null) {
        return Types.DECIMAL;
      }
      else {
        if(an.storageType() == DecimalPrecision.StorageType.NATIVE){
          return Types.DECIMAL;
        }else if(an.storageType() == DecimalPrecision.StorageType.STRING) {
          return Types.VARCHAR;
        }else if(an.storageType() == DecimalPrecision.StorageType.DOUBLE) {
          return Types.DOUBLE;         
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.