Package com.intersys.gds.noschema

Examples of com.intersys.gds.noschema.NoSchemaDocument


   /** Test and profile load data.
    */
    void load() {
        long start = getTime();
        for (int i=0;i<documentCount;i++) {
            NoSchemaDocument customer = customers.load(""+i,customersData.get(0));
            if (i == 2) {
                System.out.println(customer.toJSON("\r\n"));
            }
        }
        reportQuery(documentCount,start);
    }
View Full Code Here


    *
    */
    static ArrayList<NoSchemaDocument> generateAddresses(int count) {
        ArrayList<NoSchemaDocument> addresses = new ArrayList<NoSchemaDocument>();
        for (int i=0;i<count;i++) {
            NoSchemaDocument address = new NoSchemaDocument();
            address.put("street","One Memorial Drive");
            if (i == 0) {
                address.put("city","Cambridge");
                address.put("state","MA");
                address.put("zip",randomZip());
            }
            if (i % 2 == 0) {
                address.put("city","Cambridge");
                address.put("state","MA");
            } else {
                address.put("zip",randomZip());
            }
            if ((i % 4 == 0) || (i % 3 == 0)) {
                address.put("country","USA");
            }
            addresses.add(address);
        }
        return addresses;
    }
View Full Code Here

    *
    */
    static ArrayList<NoSchemaDocument> generateAccounts(int count) {
        ArrayList<NoSchemaDocument> accounts = new ArrayList<NoSchemaDocument>();
        for (int i=0;i<count;i++) {
            NoSchemaDocument account = new NoSchemaDocument();
            account.put("number",getUniqueAccountNumber());
            account.put("type","SAV");
            account.put("balance",randomFloat());
            if (i % 7 == 0) {
                account.put("opened",randomDate());
            }
            account.put("owner",i);
            NoSchemaDocument[] transactions = null;

            if ((i % 2 == 0) || (i % 3 == 0) || (i == 0)) {
                transactions = new NoSchemaDocument[2];
                transactions[0]= new NoSchemaDocument();
                transactions[1]= new NoSchemaDocument();
                transactions[0].put("type","WITH");
                transactions[0].put("timestamp",randomTimestamp());
                transactions[0].put("amount",randomInt(0,10000));

                transactions[1].put("type","DEPO");
                transactions[1].put("timestamp",randomTimestamp());
                transactions[1].put("amount",randomInt(0,1000));
            }
            if (i % 5 == 0) {
                transactions = new NoSchemaDocument[1];
                transactions[0]= new NoSchemaDocument();
                transactions[0].put("type","WIRE");
                transactions[0].put("timestamp",randomTimestamp());
                transactions[0].put("amount",randomInt(0,10000));
            }
            account.put("transactions", transactions);
            accounts.add(account);
        }
        return accounts;
    }
View Full Code Here

    */
    static ArrayList<NoSchemaDocument> generateCustomers(int count, ArrayList<NoSchemaDocument> accounts) {
        ArrayList<NoSchemaDocument> customers = new ArrayList<NoSchemaDocument>();
        ArrayList<NoSchemaDocument> addressesData = generateAddresses(count);
        for (int i=0;i<count;i++) {
            NoSchemaDocument customer = new NoSchemaDocument();
            customer.put("name",randomName());
            customer.put("ssn",randomSSN());
            customer.put("dob",randomDate());
            customer.put("age",randomInt(18,99));
            if ((i == 0) || (i % 2 == 0)) {
                customer.put("home phone",randomPhone());
            }
            if ((i == 0) || (i % 3 == 0)) {
                customer.put("cell phone",randomPhone());
            }
            customer.put("address",addressesData.get(i));
            customer.put("account",accounts.get(i));
            customers.add(customer);
        }
        return customers;
    }
View Full Code Here

TOP

Related Classes of com.intersys.gds.noschema.NoSchemaDocument

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.