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

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


            }
        }

        public void load(CmpEntityBeanContext ctx, FieldState state) {
            Object value;
            EntityTable relatedTable = relatedEntity.getTable();

            Connection con = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
                if (log.isDebugEnabled()) {
                    log.debug("executing: " + loadSql);
                }

                con = relatedTable.getDataSource().getConnection();
                ps = con.prepareStatement(loadSql);

                JDBCCMPFieldBridge2[] pkFields = (JDBCCMPFieldBridge2[]) entity.getPrimaryKeyFields();

                Object myPk = ctx.getPrimaryKey();
                int paramInd = 1;
                for (int i = 0; i < pkFields.length; ++i) {
                    JDBCCMPFieldBridge2 pkField = pkFields[i];
                    Object fieldValue = pkField.getPrimaryKeyValue(myPk);

                    JDBCCMPFieldBridge2 relatedFkField = tableKeyFields[i];
                    relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
                }

                rs = ps.executeQuery();

                while (rs.next()) {
                    value = relatedTable.loadRow(rs, false);
                    state.addLoadedPk(value);
                }
            } catch (SQLException e) {
                throw CmpMessages.MESSAGES.failedToLoadRelatedRole(entity.getEntityName(), getFieldName(), e);
            } finally {
View Full Code Here


            }
        }

        public void load(CmpEntityBeanContext ctx, FieldState state) {
            Object value;
            EntityTable relatedTable = relatedEntity.getTable();

            Connection con = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
                if (log.isDebugEnabled()) {
                    log.debug("executing: " + loadSql);
                }

                con = relatedTable.getDataSource().getConnection();
                ps = con.prepareStatement(loadSql);

                JDBCCMPFieldBridge2[] relatedFkFields = relatedCMRField.foreignKeyFields;
                JDBCCMPFieldBridge2[] myPkFields = relatedCMRField.relatedPKFields;

                Object myPk = ctx.getPrimaryKey();
                int paramInd = 1;
                for (int i = 0; i < relatedFkFields.length; ++i) {
                    JDBCCMPFieldBridge2 myPkField = myPkFields[i];
                    Object fieldValue = myPkField.getPrimaryKeyValue(myPk);

                    JDBCCMPFieldBridge2 relatedFkField = relatedFkFields[i];
                    relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
                }

                rs = ps.executeQuery();

                while (rs.next()) {
                    value = relatedTable.loadRow(rs, false);
                    state.addLoadedPk(value);
                }
            } catch (SQLException e) {
                throw CmpMessages.MESSAGES.failedToLoadRelatedRole(entity.getEntityName(), getFieldName(), e);
            } finally {
View Full Code Here

            }
        }

        public void load(CmpEntityBeanContext ctx, FieldState state) {
            Object value;
            EntityTable relatedTable = relatedEntity.getTable();

            Connection con = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
                if (log.isDebugEnabled()) {
                    log.debug("executing: " + loadSql);
                }

                con = relatedTable.getDataSource().getConnection();
                ps = con.prepareStatement(loadSql);

                JDBCCMPFieldBridge2[] pkFields = (JDBCCMPFieldBridge2[]) entity.getPrimaryKeyFields();

                Object myPk = ctx.getPrimaryKey();
                int paramInd = 1;
                for (int i = 0; i < pkFields.length; ++i) {
                    JDBCCMPFieldBridge2 pkField = pkFields[i];
                    Object fieldValue = pkField.getPrimaryKeyValue(myPk);

                    JDBCCMPFieldBridge2 relatedFkField = tableKeyFields[i];
                    relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
                }

                rs = ps.executeQuery();

                while (rs.next()) {
                    value = relatedTable.loadRow(rs, false);
                    state.addLoadedPk(value);
                }
            } catch (SQLException e) {
                log.error("Failed to load related role: ejb-name="
                        +
View Full Code Here

            }
        }

        public void load(CmpEntityBeanContext ctx, FieldState state) {
            Object value;
            EntityTable relatedTable = relatedEntity.getTable();

            Connection con = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
                if (log.isDebugEnabled()) {
                    log.debug("executing: " + loadSql);
                }

                con = relatedTable.getDataSource().getConnection();
                ps = con.prepareStatement(loadSql);

                JDBCCMPFieldBridge2[] relatedFkFields = relatedCMRField.foreignKeyFields;
                JDBCCMPFieldBridge2[] myPkFields = relatedCMRField.relatedPKFields;

                Object myPk = ctx.getPrimaryKey();
                int paramInd = 1;
                for (int i = 0; i < relatedFkFields.length; ++i) {
                    JDBCCMPFieldBridge2 myPkField = myPkFields[i];
                    Object fieldValue = myPkField.getPrimaryKeyValue(myPk);

                    JDBCCMPFieldBridge2 relatedFkField = relatedFkFields[i];
                    relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
                }

                rs = ps.executeQuery();

                while (rs.next()) {
                    value = relatedTable.loadRow(rs, false);
                    state.addLoadedPk(value);
                }
            } catch (SQLException e) {
                log.error("Failed to load related role: ejb-name="
                        +
View Full Code Here

            }
        }

        public void load(CmpEntityBeanContext ctx, FieldState state) {
            Object value;
            EntityTable relatedTable = relatedEntity.getTable();

            Connection con = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
                if (log.isDebugEnabled()) {
                    log.debug("executing: " + loadSql);
                }

                con = relatedTable.getDataSource().getConnection();
                ps = con.prepareStatement(loadSql);

                JDBCCMPFieldBridge2[] pkFields = (JDBCCMPFieldBridge2[]) entity.getPrimaryKeyFields();

                Object myPk = ctx.getPrimaryKey();
                int paramInd = 1;
                for (int i = 0; i < pkFields.length; ++i) {
                    JDBCCMPFieldBridge2 pkField = pkFields[i];
                    Object fieldValue = pkField.getPrimaryKeyValue(myPk);

                    JDBCCMPFieldBridge2 relatedFkField = tableKeyFields[i];
                    relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
                }

                rs = ps.executeQuery();

                while (rs.next()) {
                    value = relatedTable.loadRow(rs, false);
                    state.addLoadedPk(value);
                }
            } catch (SQLException e) {
                log.error("Failed to load related role: ejb-name="
                        +
View Full Code Here

            }
        }

        public void load(CmpEntityBeanContext ctx, FieldState state) {
            Object value;
            EntityTable relatedTable = relatedEntity.getTable();

            Connection con = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
                if (log.isDebugEnabled()) {
                    log.debug("executing: " + loadSql);
                }

                con = relatedTable.getDataSource().getConnection();
                ps = con.prepareStatement(loadSql);

                JDBCCMPFieldBridge2[] relatedFkFields = relatedCMRField.foreignKeyFields;
                JDBCCMPFieldBridge2[] myPkFields = relatedCMRField.relatedPKFields;

                Object myPk = ctx.getPrimaryKey();
                int paramInd = 1;
                for (int i = 0; i < relatedFkFields.length; ++i) {
                    JDBCCMPFieldBridge2 myPkField = myPkFields[i];
                    Object fieldValue = myPkField.getPrimaryKeyValue(myPk);

                    JDBCCMPFieldBridge2 relatedFkField = relatedFkFields[i];
                    relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
                }

                rs = ps.executeQuery();

                while (rs.next()) {
                    value = relatedTable.loadRow(rs, false);
                    state.addLoadedPk(value);
                }
            } catch (SQLException e) {
                log.error("Failed to load related role: ejb-name="
                        +
View Full Code Here

            }
        }

        public void load(CmpEntityBeanContext ctx, FieldState state) {
            Object value;
            EntityTable relatedTable = relatedEntity.getTable();

            Connection con = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
                if (log.isDebugEnabled()) {
                    log.debug("executing: " + loadSql);
                }

                con = relatedTable.getDataSource().getConnection();
                ps = con.prepareStatement(loadSql);

                JDBCCMPFieldBridge2[] pkFields = (JDBCCMPFieldBridge2[]) entity.getPrimaryKeyFields();

                Object myPk = ctx.getPrimaryKeyUnchecked();
                int paramInd = 1;
                for (int i = 0; i < pkFields.length; ++i) {
                    JDBCCMPFieldBridge2 pkField = pkFields[i];
                    Object fieldValue = pkField.getPrimaryKeyValue(myPk);

                    JDBCCMPFieldBridge2 relatedFkField = tableKeyFields[i];
                    relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
                }

                rs = ps.executeQuery();

                while (rs.next()) {
                    value = relatedTable.loadRow(rs, false);
                    state.addLoadedPk(value);
                }
            } catch (SQLException e) {
                throw CmpMessages.MESSAGES.failedToLoadRelatedRole(entity.getEntityName(), getFieldName(), e);
            } finally {
View Full Code Here

            }
        }

        public void load(CmpEntityBeanContext ctx, FieldState state) {
            Object value;
            EntityTable relatedTable = relatedEntity.getTable();

            Connection con = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
                if (log.isDebugEnabled()) {
                    log.debug("executing: " + loadSql);
                }

                con = relatedTable.getDataSource().getConnection();
                ps = con.prepareStatement(loadSql);

                JDBCCMPFieldBridge2[] relatedFkFields = relatedCMRField.foreignKeyFields;
                JDBCCMPFieldBridge2[] myPkFields = relatedCMRField.relatedPKFields;

                Object myPk = ctx.getPrimaryKeyUnchecked();
                int paramInd = 1;
                for (int i = 0; i < relatedFkFields.length; ++i) {
                    JDBCCMPFieldBridge2 myPkField = myPkFields[i];
                    Object fieldValue = myPkField.getPrimaryKeyValue(myPk);

                    JDBCCMPFieldBridge2 relatedFkField = relatedFkFields[i];
                    relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
                }

                rs = ps.executeQuery();

                while (rs.next()) {
                    value = relatedTable.loadRow(rs, false);
                    state.addLoadedPk(value);
                }
            } catch (SQLException e) {
                throw CmpMessages.MESSAGES.failedToLoadRelatedRole(entity.getEntityName(), getFieldName(), e);
            } finally {
View Full Code Here

            }
        }

        public void load(CmpEntityBeanContext ctx, FieldState state) {
            Object value;
            EntityTable relatedTable = relatedEntity.getTable();

            Connection con = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
                if (log.isDebugEnabled()) {
                    log.debug("executing: " + loadSql);
                }

                con = relatedTable.getDataSource().getConnection();
                ps = con.prepareStatement(loadSql);

                JDBCCMPFieldBridge2[] pkFields = (JDBCCMPFieldBridge2[]) entity.getPrimaryKeyFields();

                Object myPk = ctx.getPrimaryKeyUnchecked();
                int paramInd = 1;
                for (int i = 0; i < pkFields.length; ++i) {
                    JDBCCMPFieldBridge2 pkField = pkFields[i];
                    Object fieldValue = pkField.getPrimaryKeyValue(myPk);

                    JDBCCMPFieldBridge2 relatedFkField = tableKeyFields[i];
                    relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
                }

                rs = ps.executeQuery();

                while (rs.next()) {
                    value = relatedTable.loadRow(rs, false);
                    state.addLoadedPk(value);
                }
            } catch (SQLException e) {
                throw CmpMessages.MESSAGES.failedToLoadRelatedRole(entity.getEntityName(), getFieldName(), e);
            } finally {
View Full Code Here

            }
        }

        public void load(CmpEntityBeanContext ctx, FieldState state) {
            Object value;
            EntityTable relatedTable = relatedEntity.getTable();

            Connection con = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
                if (log.isDebugEnabled()) {
                    log.debug("executing: " + loadSql);
                }

                con = relatedTable.getDataSource().getConnection();
                ps = con.prepareStatement(loadSql);

                JDBCCMPFieldBridge2[] relatedFkFields = relatedCMRField.foreignKeyFields;
                JDBCCMPFieldBridge2[] myPkFields = relatedCMRField.relatedPKFields;

                Object myPk = ctx.getPrimaryKeyUnchecked();
                int paramInd = 1;
                for (int i = 0; i < relatedFkFields.length; ++i) {
                    JDBCCMPFieldBridge2 myPkField = myPkFields[i];
                    Object fieldValue = myPkField.getPrimaryKeyValue(myPk);

                    JDBCCMPFieldBridge2 relatedFkField = relatedFkFields[i];
                    relatedFkField.setArgumentParameters(ps, paramInd++, fieldValue);
                }

                rs = ps.executeQuery();

                while (rs.next()) {
                    value = relatedTable.loadRow(rs, false);
                    state.addLoadedPk(value);
                }
            } catch (SQLException e) {
                throw CmpMessages.MESSAGES.failedToLoadRelatedRole(entity.getEntityName(), getFieldName(), e);
            } finally {
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.