/** * Return the JDBC type for the Java type. For some reason PostgreSQL does * not seem to like the JDBC Blob type (PostgreSQL 8.2). */ @Override public int getJDBCType(Class javaType) { if (javaType == ClassConstants.BLOB) { return Types.LONGVARBINARY; } return super.getJDBCType(javaType); }
@Override public int getJDBCType(Class javaType) { if (javaType == ClassConstants.TIME_ODATETIME) { return Types.TIMESTAMP; } else if (javaType == ClassConstants.TIME_OTIME) { return Types.TIME; } return super.getJDBCType(javaType); }
/** * Return the JDBC type for the Java type. For some reason PostgreSQL does * not seem to like the JDBC Blob type (PostgreSQL 8.2). */ @Override public int getJDBCType(Class javaType) { if (javaType == ClassConstants.BLOB) { return Types.LONGVARBINARY; } return super.getJDBCType(javaType); }
/** * Return the JDBC type for the Java type. For some reason PostgreSQL does * not seem to like the JDBC Blob type (PostgreSQL 8.2). */ @Override public int getJDBCType(Class javaType) { if (javaType == ClassConstants.BLOB) { return Types.LONGVARBINARY; } return super.getJDBCType(javaType); }
/** * Sybase and SQL Anywhere do not support BLOB/CLOB but require LONGVARBINARY/LONGVARCHAR. */ @Override public int getJDBCType(Class javaType) { if (javaType == ClassConstants.BLOB) { return Types.LONGVARBINARY; } else if (javaType == ClassConstants.CLOB) { return Types.LONGVARCHAR; } else { return super.getJDBCType(javaType); } }
/** * Sybase and SQL Anywhere do not support BLOB/CLOB but require LONGVARBINARY/LONGVARCHAR. */ @Override public int getJDBCType(Class javaType) { if (javaType == ClassConstants.BLOB) { return Types.LONGVARBINARY; } else if (javaType == ClassConstants.CLOB) { return Types.LONGVARCHAR; } else { return super.getJDBCType(javaType); } }
@Override protected void setSingleResult(XRServiceAdapter xrService, StoredProcedureCall spCall, QName resultType) { if (isCursorType(xrService, resultType)) { spCall.useUnnamedCursorOutputAsResultSet(); } else { StoredFunctionCall sfCall = (StoredFunctionCall)spCall; Class<?> clz = SCHEMA_2_CLASS.get(resultType); if (clz != null) { sfCall.setResult("", clz); } else { sfCall.setResult("", OBJECT); } DatabasePlatform platform = xrService.getORSession().getPlatform(); if (platform == null) { platform = new DatabasePlatform(); } // StoredFunction's return value is the first parameter ((DatabaseField)sfCall.getParameters().get(0)).setSqlType( platform.getJDBCType(clz)); } } }
@Override protected void setSingleResult(XRServiceAdapter xrService, StoredProcedureCall spCall, QName resultType) { if (isCursorType(xrService, resultType)) { spCall.useUnnamedCursorOutputAsResultSet(); } else { StoredFunctionCall sfCall = (StoredFunctionCall)spCall; Class<?> clz = SCHEMA_2_CLASS.get(resultType); if (clz != null) { sfCall.setResult("", clz); } else { sfCall.setResult("", OBJECT); } DatabasePlatform platform = xrService.getORSession().getPlatform(); if (platform == null) { platform = new DatabasePlatform(); } // StoredFunction's return value is the first parameter ((DatabaseField)sfCall.getParameters().get(0)).setSqlType( platform.getJDBCType(clz)); } } }
DatabaseField field = mapping.getField(); DatabasePlatform platform = serverSession.getPlatform(); sqlType = platform.getJDBCType(field); } else { sqlType = Types.OTHER;
/** * entityDescからdataSetのカラム定義を生成します。 */ protected void setupAttributeColumns() { ServerSession serverSession = getEntityDesc().getServerSession(); ClassDescriptor cd = serverSession.getClassDescriptor(getEntityDesc().getEntityClass()); DatabasePlatform platform = serverSession.getPlatform(); for (DatabaseField field : cd.getFields()) { DataTable table = dataSet.getTable(field.getTableName()); int sqlType = platform.getJDBCType(field); String columnName = field.getName(); if (!table.hasColumn(columnName)) { table.addColumn(columnName, ColumnTypes.getColumnType(sqlType)); } } }
/** * entityDescからInheritancePolicyを取得し、継承関連のカラムをdataSetに定義します。 */ protected void setupDiscriminatorColumn() { if (!getEntityDesc().hasDiscriminatorColumn()) { return; } InheritancePolicy inheritancePolicy = getEntityDesc().getInheritancePolicy(); DatabaseField field = inheritancePolicy.getClassIndicatorField(); DataTable table = dataSet.getTable(field.getTableName()); ServerSession serverSession = getEntityDesc().getServerSession(); DatabasePlatform platform = serverSession.getPlatform(); int sqlType = platform.getJDBCType(field); String columnName = field.getName(); if (!table.hasColumn(columnName)) { table.addColumn(columnName, ColumnTypes.getColumnType(sqlType)); } }