Package org.jboss.ejb.plugins.cmp.jdbc.metadata

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCFunctionMappingMetaData


/*      */   }
/*      */
/*      */   public Object visit(ASTLength node, Object data)
/*      */   {
/* 1470 */     StringBuffer buf = (StringBuffer)data;
/* 1471 */     JDBCFunctionMappingMetaData function = this.typeMapping.getFunctionMapping("length");
/* 1472 */     Object[] args = { new NodeStringWrapper(node.jjtGetChild(0)) };
/*      */
/* 1475 */     function.getFunctionSql(args, buf);
/* 1476 */     return buf;
/*      */   }
View Full Code Here


/*      */
/*      */   public Object visit(ASTLocate node, Object data)
/*      */   {
/* 1484 */     StringBuffer buf = (StringBuffer)data;
/*      */
/* 1486 */     JDBCFunctionMappingMetaData function = this.typeMapping.getFunctionMapping("locate");
/* 1487 */     Object[] args = new Object[3];
/* 1488 */     args[0] = new NodeStringWrapper(node.jjtGetChild(0));
/* 1489 */     args[1] = new NodeStringWrapper(node.jjtGetChild(1));
/* 1490 */     if (node.jjtGetNumChildren() == 3)
/*      */     {
/* 1492 */       args[2] = new NodeStringWrapper(node.jjtGetChild(2));
/*      */     }
/*      */     else
/*      */     {
/* 1496 */       args[2] = "1";
/*      */     }
/*      */
/* 1500 */     function.getFunctionSql(args, buf);
/* 1501 */     return buf;
/*      */   }
View Full Code Here

/*      */   }
/*      */
/*      */   public Object visit(ASTAbs node, Object data)
/*      */   {
/* 1509 */     StringBuffer buf = (StringBuffer)data;
/* 1510 */     JDBCFunctionMappingMetaData function = this.typeMapping.getFunctionMapping("abs");
/* 1511 */     Object[] args = { new NodeStringWrapper(node.jjtGetChild(0)) };
/*      */
/* 1514 */     function.getFunctionSql(args, buf);
/* 1515 */     return buf;
/*      */   }
View Full Code Here

/*      */   }
/*      */
/*      */   public Object visit(ASTMod node, Object data)
/*      */   {
/* 1523 */     StringBuffer buf = (StringBuffer)data;
/* 1524 */     JDBCFunctionMappingMetaData function = this.typeMapping.getFunctionMapping("mod");
/* 1525 */     Object[] args = { new NodeStringWrapper(node.jjtGetChild(0)), new NodeStringWrapper(node.jjtGetChild(1)) };
/*      */
/* 1529 */     function.getFunctionSql(args, buf);
/* 1530 */     return buf;
/*      */   }
View Full Code Here

/*      */   }
/*      */
/*      */   public Object visit(ASTSqrt node, Object data)
/*      */   {
/* 1538 */     StringBuffer buf = (StringBuffer)data;
/* 1539 */     JDBCFunctionMappingMetaData function = this.typeMapping.getFunctionMapping("sqrt");
/* 1540 */     Object[] args = { new NodeStringWrapper(node.jjtGetChild(0)) };
/*      */
/* 1543 */     function.getFunctionSql(args, buf);
/* 1544 */     return buf;
/*      */   }
View Full Code Here

/*     */     {
/* 265 */       relationTableAlias = "";
/* 266 */       relatedTableAlias = "";
/*     */     }
/*     */
/* 269 */     JDBCFunctionMappingMetaData selectTemplate = getSelectTemplate(cmrField);
/* 270 */     return selectTemplate == null ? getPlainSQL(keyCount, myKeyFields, relationTableAlias, relatedKeyFields, preloadMask, cmrField, relatedTableAlias, relationTable, join, relatedTable) : getSQLByTemplate(keyCount, myKeyFields, relationTableAlias, relatedKeyFields, preloadMask, cmrField, relatedTableAlias, relationTable, join, relatedTable, selectTemplate);
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   private JDBCFunctionMappingMetaData getSelectTemplate(JDBCCMRFieldBridge cmrField)
/*     */     throws DeploymentException
/*     */   {
/* 388 */     JDBCFunctionMappingMetaData selectTemplate = null;
/* 389 */     if (cmrField.getRelationMetaData().isTableMappingStyle())
/*     */     {
/* 392 */       if (cmrField.getRelationMetaData().hasRowLocking())
/*     */       {
/* 394 */         selectTemplate = cmrField.getRelationMetaData().getTypeMapping().getRowLockingTemplate();
View Full Code Here

/* 105 */     SQLUtil.getWhereClause(entity.getPrimaryKeyFields(), alias, where);
/*     */
/* 108 */     StringBuffer sql = new StringBuffer(300);
/* 109 */     if ((this.rowLocking) && (readAhead.isOnFind()) && (getEagerLoadMask() != null))
/*     */     {
/* 111 */       JDBCFunctionMappingMetaData rowLockingTemplate = typeMapping.getRowLockingTemplate();
/* 112 */       rowLockingTemplate.getFunctionSql(new Object[] { select, from, where.length() == 0 ? null : where, null }, sql);
/*     */     }
/*     */     else
/*     */     {
/* 124 */       sql.append("SELECT ").append(select).append(" FROM ").append(from).append(" WHERE ").append(where);
/*     */     }
View Full Code Here

/* 147 */         String longType = typeMapping.getTypeMappingMetaData(Long.class).getSqlType();
/* 148 */         String objectType = objectMetaData.getSqlType();
/*     */
/* 151 */         StringBuffer createTableDDL = new StringBuffer("create table " + getTableName() + " (" + " " + getColumnTimerID() + " varchar(80) not null," + " " + getColumnTargetID() + " varchar(250) not null," + " " + getColumnInitialDate() + " " + dateType + " not null," + " " + getColumnTimerInterval() + " " + longType + "," + " " + getColumnInstancePK() + " " + objectType + "," + " " + getColumnInfo() + " " + objectType + ", ");
/*     */
/* 160 */         JDBCFunctionMappingMetaData pkConstraint = typeMapping.getPkConstraintTemplate();
/* 161 */         String[] templateParams = { getTableName() + "_PK", getColumnTimerID() + ", " + getColumnTargetID() };
/*     */
/* 165 */         pkConstraint.getFunctionSql(templateParams, createTableDDL);
/*     */
/* 168 */         createTableDDL.append(" )");
/*     */
/* 170 */         log.debug("Executing DDL: " + createTableDDL);
/*     */
View Full Code Here

/*  326 */     if (this.entity.getMetaData().hasRowLocking())
/*      */     {
/*  328 */       JDBCEntityPersistenceStore manager = this.entity.getManager();
/*  329 */       JDBCTypeFactory typeFactory = manager.getJDBCTypeFactory();
/*  330 */       JDBCTypeMappingMetaData typeMapping = typeFactory.getTypeMapping();
/*  331 */       JDBCFunctionMappingMetaData rowLockingTemplate = typeMapping.getRowLockingTemplate();
/*  332 */       if (rowLockingTemplate == null)
/*      */       {
/*  334 */         throw new DeploymentException("Row locking template is not defined for mapping: " + typeMapping.getName());
/*      */       }
/*      */
/*  337 */       this.selectSql = rowLockingTemplate.getFunctionSql(new Object[] { selectColumns, this.tableName, whereColumns, null }, new StringBuffer()).toString();
/*      */     }
/*      */     else
/*      */     {
/*  342 */       this.selectSql = "select ";
/*  343 */       this.selectSql += selectColumns;
View Full Code Here

TOP

Related Classes of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCFunctionMappingMetaData

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.