Package org.jboss.as.cmp.jdbc.metadata

Examples of org.jboss.as.cmp.jdbc.metadata.JDBCRelationMetaData


                    if (joinedAliases.add(joinAlias)) {
                        final JDBCAbstractCMRFieldBridge cmrField = (JDBCAbstractCMRFieldBridge) path.getCMRField(i);
                        final JDBCAbstractEntityBridge joinEntity = (JDBCAbstractEntityBridge) cmrField.getRelatedEntity();

                        JDBCRelationMetaData relation = cmrField.getMetaData().getRelationMetaData();

                        String join = (path.innerJoin ? " INNER JOIN " : " LEFT OUTER JOIN ");

                        if (relation.isTableMappingStyle()) {
                            String relTableAlias = aliasManager.getRelationTableAlias(curPath);
                            sql.append(join)
                                    .append(cmrField.getQualifiedTableName())
                                    .append(' ')
                                    .append(relTableAlias)
View Full Code Here


        // drop relation tables
        JDBCAbstractCMRFieldBridge[] cmrFields = entity.getCMRFields();
        for (int i = 0; i < cmrFields.length; ++i) {
            JDBCAbstractCMRFieldBridge cmrField = cmrFields[i];
            JDBCRelationMetaData relationMetaData = cmrField.getMetaData().getRelationMetaData();
            if (relationMetaData.isTableMappingStyle() && !relationMetaData.isTableDropped()) {
                if (relationMetaData.getRemoveTable()) {
                    final boolean dropped = dropTable(manager.getDataSource(relationMetaData.getDataSourceName()), cmrField.getQualifiedTableName());
                    if (!dropped) {
                        success = false;
                    } else {
                        relationMetaData.setTableDropped();
                    }
                }
            }
        }
View Full Code Here

        this.schema = schema;
        this.tableId = tableId;
        this.leftField = leftField;
        this.rightField = rightField;

        JDBCRelationMetaData metadata = leftField.getMetaData().getRelationMetaData();
        ds = leftField.getManager().getDataSource(metadata.getDataSourceName());
        tableName = SQLUtil.fixTableName(metadata.getDefaultTableName(), ds);

        log = Logger.getLogger(getClass().getName() + "." + tableName);

        // generate sql
View Full Code Here

        for (LeftJoinCMRNode node : onFindCMRNodes) {
            JDBCCMRFieldBridge cmrField = node.cmrField;
            JDBCEntityBridge relatedEntity = cmrField.getRelatedJDBCEntity();
            String relatedAlias = aliasManager.getAlias(node.path);

            JDBCRelationMetaData relation = cmrField.getMetaData().getRelationMetaData();
            if (relation.isTableMappingStyle()) {
                String relTableAlias = aliasManager.getRelationTableAlias(node.path);
                sb.append(" LEFT OUTER JOIN ")
                        .append(cmrField.getQualifiedTableName())
                        .append(' ')
                        .append(relTableAlias)
View Full Code Here

TOP

Related Classes of org.jboss.as.cmp.jdbc.metadata.JDBCRelationMetaData

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.