Package ke.go.moh.oec.adt.data

Examples of ke.go.moh.oec.adt.data.RecordSource


        int recordSourceCount = recordSourceNodeList.getLength();
        List<Integer> orderList = new ArrayList<Integer>();
        for (int i = 0; i < recordSourceCount; i++) {
            Node recordSourceNode = recordSourceNodeList.item(i);
            if (recordSourceNode.getNodeType() == Node.ELEMENT_NODE) {
                RecordSource recordSource = createRecordSource(recordSourceNode);
                if (orderList.contains(recordSource.getOrder())) {
                    throw new BadRecordSourceException("The order " + recordSource.getOrder()
                            + " has been allocated to more than one record sources. Unique order expected.");
                }
                if (recordSourceList.contains(recordSource)) {
                    throw new BadRecordSourceException("Record source for "
                            + recordSource.getTableName() + " configured more than once in the xml "
                            + "configuration file. Only one instance is expected.");
                }
                recordSourceList.add(recordSource);
                orderList.add(recordSource.getOrder());
            }
        }
        Collections.sort(recordSourceList);
        return recordSourceList;
    }
View Full Code Here


        return connection;
    }

    private RecordSource createRecordSource(Node recordSourceNode) throws BadRecordSourceException {
        Element recordSourceElement = (Element) recordSourceNode;
        RecordSource recordSource = new RecordSource(Integer.parseInt(readTagValue(recordSourceElement, "order")));
        recordSource.setRelationship(RecordSource.Relationship.valueOf(readTagValue(recordSourceElement, "relationship").toUpperCase().trim()));
        recordSource.setTableName(readTagValue(recordSourceElement, "table_name"));
        recordSource.setPrimaryKeyColumnMap(readKeyColumns(recordSourceElement, "primary_key_column"));
        recordSource.setForeignKeyColumnMap(readKeyColumns(recordSourceElement, "foreign_key_column"));
        recordSource.setCumulate(Boolean.parseBoolean(readTagValue(recordSourceElement, "cumulate")));
        String limitString = readTagValue(recordSourceElement, "limit");
        if (limitString != null) {
            recordSource.setLimit(Integer.parseInt(limitString));
        }
        List<Column> columnList = readOrdinaryColumns(recordSourceElement, "columns");
        if (!columnList.isEmpty()) {
            recordSource.setColumnList(columnList);
        }
        validateRecordSource(recordSource);
        return recordSource;
    }
View Full Code Here

TOP

Related Classes of ke.go.moh.oec.adt.data.RecordSource

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.