Package org.jboss.as.cmp.jdbc2.schema

Examples of org.jboss.as.cmp.jdbc2.schema.EntityTable$View


            con = dataSource.getConnection();
            ps = con.prepareStatement(selectSql);

            int paramInd = 1;
            for (int i = 0; i < pkFields.length; ++i) {
                JDBCCMPFieldBridge2 pkField = pkFields[i];
                Object pkValue = pkField.getPrimaryKeyValue(id);
                paramInd = pkField.setArgumentParameters(ps, paramInd, pkValue);
            }

            rs = ps.executeQuery();

            if (!rs.next()) {
View Full Code Here


            while (view.deleted != null) {
                Row row = view.deleted;

                int paramInd = 1;
                for (int pkInd = 0; pkInd < pkFields.length; ++pkInd) {
                    JDBCCMPFieldBridge2 pkField = pkFields[pkInd];
                    Object fieldValue = row.fields[pkField.getRowIndex()];
                    paramInd = pkField.setArgumentParameters(ps, paramInd, fieldValue);
                }

                deleteStrategy.executeUpdate(ps);

                ++batchCount;
View Full Code Here

            while (view.dirty != null) {
                Row row = view.dirty;

                int paramInd = 1;
                for (int fInd = 0; fInd < tableFields.length; ++fInd) {
                    JDBCCMPFieldBridge2 field = tableFields[fInd];
                    if (!field.isPrimaryKeyMember()) {
                        Object fieldValue = row.fields[field.getRowIndex()];
                        paramInd = field.setArgumentParameters(ps, paramInd, fieldValue);
                    }
                }

                for (int fInd = 0; fInd < pkFields.length; ++fInd) {
                    JDBCCMPFieldBridge2 pkField = pkFields[fInd];
                    Object fieldValue = row.fields[pkField.getRowIndex()];
                    paramInd = pkField.setArgumentParameters(ps, paramInd, fieldValue);
                }

                JDBCCMPFieldBridge2 versionField = entity.getVersionField();
                if (versionField != null) {
                    int versionIndex = versionField.getVersionIndex();
                    Object curVersion = row.fields[versionIndex];
                    paramInd = versionField.setArgumentParameters(ps, paramInd, curVersion);

                    Object newVersion = row.fields[versionField.getRowIndex()];
                    row.fields[versionIndex] = newVersion;
                }

                updateStrategy.executeUpdate(ps);
View Full Code Here

            while (view.created != null) {
                Row row = view.created;

                int paramInd = 1;
                for (int fInd = 0; fInd < tableFields.length; ++fInd) {
                    JDBCCMPFieldBridge2 field = tableFields[fInd];
                    Object fieldValue = row.fields[field.getRowIndex()];
                    paramInd = field.setArgumentParameters(ps, paramInd, fieldValue);
                }

                insertStrategy.executeUpdate(ps);

                ++batchCount;
View Full Code Here

                RelationKeys keys = view.deleted;

                int paramInd = 1;
                JDBCCMPFieldBridge2[] keyFields = (JDBCCMPFieldBridge2[]) leftField.getTableKeyFields();
                for (int pkInd = 0; pkInd < keyFields.length; ++pkInd) {
                    JDBCCMPFieldBridge2 pkField = keyFields[pkInd];
                    Object fieldValue = pkField.getPrimaryKeyValue(keys.leftKey);
                    paramInd = pkField.setArgumentParameters(ps, paramInd, fieldValue);
                }

                keyFields = (JDBCCMPFieldBridge2[]) rightField.getTableKeyFields();
                for (int pkInd = 0; pkInd < keyFields.length; ++pkInd) {
                    JDBCCMPFieldBridge2 pkField = keyFields[pkInd];
                    Object fieldValue = pkField.getPrimaryKeyValue(keys.rightKey);
                    paramInd = pkField.setArgumentParameters(ps, paramInd, fieldValue);
                }

                ps.addBatch();
                ++batchCount;
View Full Code Here

                RelationKeys keys = view.created;

                JDBCCMPFieldBridge2[] keyFields = (JDBCCMPFieldBridge2[]) leftField.getTableKeyFields();
                int paramInd = 1;
                for (int fInd = 0; fInd < keyFields.length; ++fInd) {
                    JDBCCMPFieldBridge2 field = keyFields[fInd];
                    Object fieldValue = field.getPrimaryKeyValue(keys.leftKey);
                    paramInd = field.setArgumentParameters(ps, paramInd, fieldValue);
                }

                keyFields = (JDBCCMPFieldBridge2[]) rightField.getTableKeyFields();
                for (int fInd = 0; fInd < keyFields.length; ++fInd) {
                    JDBCCMPFieldBridge2 field = keyFields[fInd];
                    Object fieldValue = field.getPrimaryKeyValue(keys.rightKey);
                    paramInd = field.setArgumentParameters(ps, paramInd, fieldValue);
                }

                ps.addBatch();
                ++batchCount;
View Full Code Here

        typeFactory = new JDBCTypeFactory(metaData.getTypeMapping(),
                metaData.getJDBCApplication().getValueClasses(),
                metaData.getJDBCApplication().getUserTypeMappings()
        );

        entityBridge = new JDBCEntityBridge2(this, metaData);
        entityBridge.init();

        Catalog catalog = getCatalog();
        catalog.addEntity(entityBridge);
View Full Code Here

        typeFactory = new JDBCTypeFactory(metaData.getTypeMapping(),
                metaData.getJDBCApplication().getValueClasses(),
                metaData.getJDBCApplication().getUserTypeMappings()
        );

        entityBridge = new JDBCEntityBridge2(this, metaData);
        entityBridge.init();

        Catalog catalog = getCatalog();
        catalog.addEntity(entityBridge);
View Full Code Here

        typeFactory = new JDBCTypeFactory(metaData.getTypeMapping(),
                metaData.getJDBCApplication().getValueClasses(),
                metaData.getJDBCApplication().getUserTypeMappings()
        );

        entityBridge = new JDBCEntityBridge2(this, metaData);
        entityBridge.init();

        Catalog catalog = getCatalog();
        catalog.addEntity(entityBridge);
View Full Code Here

    private void initResultReader(JDBCEntityBridge2 entity, JDBCDeclaredQueryMetaData metadata) {
        String entityName = metadata.getEJBName();
        if (entityName != null) {
            Catalog catalog = entity.getManager().getCatalog();
            JDBCEntityBridge2 otherEntity = (JDBCEntityBridge2) catalog.getEntityByEJBName(entityName);
            if (otherEntity == null) {
                throw new RuntimeException("Unknown entity: " + entityName);
            }
            this.entity = otherEntity;
        } else {
View Full Code Here

TOP

Related Classes of org.jboss.as.cmp.jdbc2.schema.EntityTable$View

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.