Package com.cedarsoftware.ncube.formatters

Examples of com.cedarsoftware.ncube.formatters.JsonFormatter


        return new HtmlFormatter(headers).format(this);
    }

    public String toFormattedJson()
    {
        return new JsonFormatter().format(this);
    }
View Full Code Here


        {
            PreparedStatement stmt = null;
            try
            {
                stmt = connection.prepareStatement("UPDATE n_cube SET cube_value_bin=?, update_dt=? WHERE app_cd = ? AND n_cube_nm = ? AND version_no_cd = ? AND status_cd = '" + ReleaseStatus.SNAPSHOT + "'");
                stmt.setBytes(1, new JsonFormatter().format(ncube).getBytes("UTF-8"));
                stmt.setDate(2, new java.sql.Date(System.currentTimeMillis()));
                stmt.setString(3, app);
                stmt.setString(4, ncube.getName());
                stmt.setString(5, version);
                int count = stmt.executeUpdate();
View Full Code Here

                    stmt.close();
                    stmt = connection.prepareStatement("INSERT INTO n_cube (n_cube_id, app_cd, n_cube_nm, cube_value_bin, version_no_cd, create_dt, sys_effective_dt) VALUES (?, ?, ?, ?, ?, ?, ?)");
                    stmt.setLong(1, UniqueIdGenerator.getUniqueId());
                    stmt.setString(2, app);
                    stmt.setString(3, ncube.getName());
                    String json = new JsonFormatter().format(ncube);
                    //                    String json = JsonWriter.objectToJson(ncube);
                    stmt.setBytes(4, json.getBytes("UTF-8"));
                    stmt.setString(5, version);
                    java.sql.Date now = new java.sql.Date(System.currentTimeMillis());
                    stmt.setDate(6, now);
View Full Code Here

        return new HtmlFormatter(headers).format(this);
    }

    public String toFormattedJson()
    {
        return new JsonFormatter().format(this);
    }
View Full Code Here

        synchronized (cubeList)
        {
            try(PreparedStatement stmt = connection.prepareStatement("UPDATE n_cube SET cube_value_bin=?, update_dt=? WHERE app_cd = ? AND n_cube_nm = ? AND version_no_cd = ? AND status_cd = '" + ReleaseStatus.SNAPSHOT + "'"))
            {
                stmt.setBytes(1, new JsonFormatter().format(ncube).getBytes("UTF-8"));
                stmt.setDate(2, new java.sql.Date(System.currentTimeMillis()));
                stmt.setString(3, app);
                stmt.setString(4, ncube.getName());
                stmt.setString(5, version);
                int count = stmt.executeUpdate();
View Full Code Here

                try (PreparedStatement insert = connection.prepareStatement("INSERT INTO n_cube (n_cube_id, app_cd, n_cube_nm, cube_value_bin, version_no_cd, create_dt, sys_effective_dt) VALUES (?, ?, ?, ?, ?, ?, ?)"))
                {
                    insert.setLong(1, UniqueIdGenerator.getUniqueId());
                    insert.setString(2, app);
                    insert.setString(3, ncube.getName());
                    String json = new JsonFormatter().format(ncube);
                    //                    String json = JsonWriter.objectToJson(ncube);
                    insert.setBytes(4, json.getBytes("UTF-8"));
                    insert.setString(5, version);
                    java.sql.Date now = new java.sql.Date(System.currentTimeMillis());
                    insert.setDate(6, now);
View Full Code Here

        {
            PreparedStatement stmt = null;
            try
            {
                stmt = connection.prepareStatement("UPDATE n_cube SET cube_value_bin=?, update_dt=? WHERE app_cd = ? AND n_cube_nm = ? AND version_no_cd = ? AND status_cd = '" + ReleaseStatus.SNAPSHOT + "'");
                stmt.setBytes(1, new JsonFormatter().format(ncube).getBytes("UTF-8"));
                stmt.setDate(2, new java.sql.Date(System.currentTimeMillis()));
                stmt.setString(3, app);
                stmt.setString(4, ncube.getName());
                stmt.setString(5, version);
                int count = stmt.executeUpdate();
View Full Code Here

                    stmt.close();
                    stmt = connection.prepareStatement("INSERT INTO n_cube (n_cube_id, app_cd, n_cube_nm, cube_value_bin, version_no_cd, create_dt, sys_effective_dt) VALUES (?, ?, ?, ?, ?, ?, ?)");
                    stmt.setLong(1, UniqueIdGenerator.getUniqueId());
                    stmt.setString(2, app);
                    stmt.setString(3, ncube.getName());
                    String json = new JsonFormatter().format(ncube);
                    //                    String json = JsonWriter.objectToJson(ncube);
                    stmt.setBytes(4, json.getBytes("UTF-8"));
                    stmt.setString(5, version);
                    java.sql.Date now = new java.sql.Date(System.currentTimeMillis());
                    stmt.setDate(6, now);
View Full Code Here

        {
            PreparedStatement stmt = null;
            try
            {
                stmt = connection.prepareStatement("UPDATE n_cube SET cube_value_bin=?, update_dt=? WHERE app_cd = ? AND n_cube_nm = ? AND version_no_cd = ? AND status_cd = '" + ReleaseStatus.SNAPSHOT + "'");
                stmt.setBytes(1, new JsonFormatter().format(ncube).getBytes("UTF-8"));
                stmt.setDate(2, new java.sql.Date(System.currentTimeMillis()));
                stmt.setString(3, app);
                stmt.setString(4, ncube.getName());
                stmt.setString(5, version);
                int count = stmt.executeUpdate();
View Full Code Here

                    stmt.close();
                    stmt = connection.prepareStatement("INSERT INTO n_cube (n_cube_id, app_cd, n_cube_nm, cube_value_bin, version_no_cd, create_dt, sys_effective_dt) VALUES (?, ?, ?, ?, ?, ?, ?)");
                    stmt.setLong(1, UniqueIdGenerator.getUniqueId());
                    stmt.setString(2, app);
                    stmt.setString(3, ncube.getName());
                    String json = new JsonFormatter().format(ncube);
                    //                    String json = JsonWriter.objectToJson(ncube);
                    stmt.setBytes(4, json.getBytes("UTF-8"));
                    stmt.setString(5, version);
                    java.sql.Date now = new java.sql.Date(System.currentTimeMillis());
                    stmt.setDate(6, now);
View Full Code Here

TOP

Related Classes of com.cedarsoftware.ncube.formatters.JsonFormatter

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.