Package com.asakusafw.runtime.value

Examples of com.asakusafw.runtime.value.Date


            all.set("c_short", (short) 1023);
            all.set("c_long", 100000L);
            all.set("c_float", 1.5f);
            all.set("c_double", 2.5f);
            all.set("c_decimal", new BigDecimal("3.1415"));
            all.set("c_date", new Date(2011, 9, 1));
            all.set("c_datetime", new DateTime(2011, 12, 31, 23, 59, 59));
            p.setParameters(all.unwrap());
            ps.executeUpdate();

            ps.close();
View Full Code Here


        all.set("c_short", (short) 1023);
        all.set("c_long", 100000L);
        all.set("c_float", 1.5f);
        all.set("c_double", 2.5f);
        all.set("c_decimal", new BigDecimal("3.1415"));
        all.set("c_date", new Date(2011, 9, 1));
        all.set("c_datetime", new DateTime(2011, 12, 31, 23, 59, 59));

        DataModelStreamSupport<Object> unsafe = unsafe(support);

        ByteArrayOutputStream output = new ByteArrayOutputStream();
View Full Code Here

        ModelLoader loaded = generateJava("attributes");
        ModelWrapper model = loaded.newModel("Model");
        model.set("text_value", new Text("\u3042\u3044\u3046\u3048\u304a"));
        model.set("true_value", true);
        model.set("false_value", false);
        model.set("date_value", new Date(2011, 10, 11));
        model.set("date_time_value", new DateTime(2011, 1, 2, 13, 14, 15));
        DataModelStreamSupport<Object> support = unsafe(loaded.newObject("csv", "ModelCsvSupport"));

        ByteArrayOutputStream output = new ByteArrayOutputStream();
        DataModelWriter<Object> writer = support.createWriter("hello", output);
View Full Code Here

        }

        @SuppressWarnings("deprecation")
        @Override
        protected Timestamp toTimestamp(ValueOption<?> object) {
            Date value = ((DateOption) object).get();
            return new Timestamp(
                    value.getYear() - 1900, value.getMonth() - 1, value.getDay(),
                    0, 0, 0, 0);
        }
View Full Code Here

    public java.sql.Date getPrimitiveJavaObject(Object o) {
        DateOption object = (DateOption) o;
        if (object == null || object.isNull()) {
            return null;
        }
        Date value = object.get();

        // FIXME for optimization
        @SuppressWarnings("deprecation")
        java.sql.Date result = new java.sql.Date(value.getYear() - 1900, value.getMonth() - 1, value.getDay());
        return result;
    }
View Full Code Here

    public DateWritable getPrimitiveWritableObject(Object o) {
        DateOption object = (DateOption) o;
        if (object == null || object.isNull()) {
            return null;
        }
        Date value = object.get();
        return new DateWritable(value.getElapsedDays() - EPOCH_OFFSET);
    }
View Full Code Here

        obj.shortOption.modify((short) 2);
        obj.intOption.modify(3);
        obj.longOption.modify(4L);
        obj.floatOption.modify(5f);
        obj.doubleOption.modify(6d);
        obj.dateOption.modify(new Date(2014, 6, 1));
        obj.dateTimeOption.modify(new DateTime(2014, 6, 1, 2, 3, 4));
        obj.stringOption.modify("Hello, world!");
        obj.decimalOption.modify(new BigDecimal("7.8"));

        DataModelInspector inspector = new DataModelInspector(descriptor);
View Full Code Here

        copy.shortOption.modify((short) 2);
        copy.intOption.modify(3);
        copy.longOption.modify(4L);
        copy.floatOption.modify(5f);
        copy.doubleOption.modify(6d);
        copy.dateOption.modify(new Date(2014, 6, 1));
        copy.dateTimeOption.modify(new DateTime(2014, 6, 1, 2, 3, 4));
        copy.stringOption.modify("Hello, world!");
        copy.decimalOption.modify(new BigDecimal("7.8"));

        driver.set(copy, obj);
View Full Code Here

        in.shortOption.modify((short) 2);
        in.intOption.modify(3);
        in.longOption.modify(4L);
        in.floatOption.modify(5f);
        in.doubleOption.modify(6d);
        in.dateOption.modify(new Date(2014, 6, 1));
        in.dateTimeOption.modify(new DateTime(2014, 6, 1, 2, 3, 4));
        in.stringOption.modify("Hello, world!");
        in.decimalOption.modify(new BigDecimal("7.8"));

        MockTypes out = restore(format, in);
View Full Code Here

            in.shortOption.modify((short) 2);
            in.intOption.modify(3);
            in.longOption.modify(4L);
            in.floatOption.modify(5f);
            in.doubleOption.modify(6d);
            in.dateOption.modify(new Date(2014, 6, 1));
            in.dateTimeOption.modify(new DateTime(2014, 6, 1, 2, 3, 4));
            in.stringOption.modify("Hello, world!");
            in.decimalOption.modify(new BigDecimal("7.8"));
            inputs.add(in);
        }
View Full Code Here

TOP

Related Classes of com.asakusafw.runtime.value.Date

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.