1

デフォルトのスキーマとして dbo を使用して、名前にドット文字が含まれているテーブルに SimpleJdbcInsert を使用しようとしています。挿入するキー値のマップを渡します。

insertMessage = new SimpleJdbcInsert(dataSource).withTableName("Trades.Transaction");
insertMessage.execute((Map)message);

次の例外が表示されます。

PreparedStatementCallback; bad SQL grammar [INSERT INTO Trades.Transaction (Uid, StreamId, Version, ValidFrom, ValidTo, IsLatest, Direction, Quantity, Notional, TradeDate, Status, Action, SettlementAmount, SettlementCurrency, AccruedInterest, BookingAccountType, BookingAccountUid, BookingAccountName, BookingAccountLegalEntityId, BookingAccountLegalEntityShortName, BookingAccountRepUid, BookingAccountRepName, BookingAccountFacilitatorUid, BookingAccountFacilitatorName, BookingAccountFacilitatorTeamCode, ContraAccountType, ContraAccountUid, ContraAccountName, ContraAccountLegalEntityId, ContraAccountLegalEntityShortName, ContraAccountRepUid, ContraAccountRepName, ContraAccountFacilitatorUid, ContraAccountFacilitatorName, ContraAccountFacilitatorTeamCode, FacingAccountType, FacingAccountUid, FacingAccountName, FacingAccountLegalEntityId, FacingAccountLegalEntityShortName, FacingAccountRepUid, FacingAccountRepName, FacingAccountFacilitatorUid, FacingAccountFacilitatorName, FacingAccountFacilitatorTeamCode, OrigSystemIsElectronicChannel, OrigSystem, OrigSystemUid, OrigSystemStatus, OrigSystemType, OrigSystemVersion, OrigSystemErrors, DestSystemUid, DestSystem, DestSystemStatus, DestSystemType, DestSystemVersion, DestSystemErrors, StpSystemUid, StpSystem, StpSystemStatus, StpSystemType, StpSystemVersion, StpSystemErrors, GatewaySystem, GatewaySystemStatus, GatewaySystemType, GatewaySystemVersion, GatewaySystemErrors, SettlementSystemUid, SettlementSystemName, SettlementSystemStatus, SettlementSystemType, SettlementSystemVersion, SettlementSystemErrors, TransactionType, Price, Obligor, Receiver, QuoteDate, EffectiveDate, MaturityDate, UnitSize, MatchedStatus, MatchedTradeId, InstrumentDescription, BookingFacilitatorTeamCode, FxClientRate, Principal, AccruedDays, SalesCommissionCode, SalesCommissionAmount, SalesCommissionRate, SalesCommissionCcy, BrokerCommissionCode, BrokerCommissionAmount, BrokerCommissionRate, BrokerCommissionCcy, MarkupCommissionCode, MarkupCommissionAmount, MarkupCommissionRate, MarkupCommissionCcy, AddOnCommissionCode, AddOnCommissionAmount, AddOnCommissionRate, AddOnCommissionCcy, PhoneConfirmInd, PhoneConfirmBy, PhoneConfirmOn, SalesManagerReview, SalesManagerReviewComments, SalesManagerReviewTime, SalesManagerReviewIndicator, TradeManagerReview, TradeManagerReviewComments, TradeManagerReviewTime, TradeManagerReviewIndicator, EnteredOn, UpdatedOn, EnteredBy, GatewaySystemUid, OrigSystemNote1, OrigSystemNote2, OrigSystemNote3, DestSystemNote1, DestSystemNote2, DestSystemNote3, GatewayAllocFlag, QuotedAmount, LastModifiedBy, OrigTransactionId, OrigMarkitWireId, ContraAccountGlobalBook, BookingAccountGlobalBook, FXSettleAmount, SettlementLocation, AssignmentFeeCd, AssignmentFeeDesc, RiskFlagCd, RiskFlagDesc, FormPurchaseCd, FormPurchaseDesc, AccruedInterestCd, AccruedInterestDesc, EcnName, EcnId, ContraAccountLocation, BookingAccountLocation, isSuppressTrade, ContraAccountTradingSystem, BookingAccountTradingSystem, isAmend, RetailCommissionCode, RetailCommissionAmount, RetailCommissionRate, RetailCommissionCcy, ContraAccountADPAccountNo, AsOfTime, ClientCommission, MarketRate, DayCount, ExecutionStatus, LinkStreamId, Spread, RfqId, isWashGen, FxRateCurrencyPair, FxRateCalcMethod, isApprovedForNewIssueAllocation, TransactionReservationId, isEligibleForTradeSync) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; nested exception is java.sql.SQLException: Incorrect syntax near the keyword 'Transaction'.

[ ] 文字で囲む方法が必要だと思うTrade.Transactionので、それを ではなく完全なテーブル名として解釈しますschema.tableName。ただし、以下のようにテーブル名で指定すると

insertMessage = new SimpleJdbcInsert(dataSource).withTableName("[Trades.Transaction]");

メタデータが見つからないため、列名を見つけて挿入ステートメントを生成できないというSpring例外が発生します。

これを解決する方法を知っている人はいますか?

ありがとう

4

0 に答える 0