castor

Builds statements with Insert class hierarchy where no special syntax is required

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.3.1
  • Component/s: JDO queries
  • Labels:
    None
  • Number of attachments :
    1

Activity

Hide
AHMAD HASSAN added a comment -

The patch includes the use of Insert class hierarchy to in Key generators. The insert hierarchy has also been improved to add sequences to insert statement. Because of that, patchSQL method has been removed from the keyGenerator interface.

I don't see any usecase in which patchSQL method would have thrown the MappingException. Because of that I removed the catch block handling in SequenceAfter and SequenceDuring keygenrator when MappingException is thrown by patchSQL method previously.

Additionally I used the added the parameterSize method in the QueryContext class which gives the number of added parameters to sql statement. In SequenceDuringKeyGenerator I used that parameter size instead of count. It would be better if we check this logic against oracle engine.

Regards, Ahmad

Show
AHMAD HASSAN added a comment - The patch includes the use of Insert class hierarchy to in Key generators. The insert hierarchy has also been improved to add sequences to insert statement. Because of that, patchSQL method has been removed from the keyGenerator interface. I don't see any usecase in which patchSQL method would have thrown the MappingException. Because of that I removed the catch block handling in SequenceAfter and SequenceDuring keygenrator when MappingException is thrown by patchSQL method previously. Additionally I used the added the parameterSize method in the QueryContext class which gives the number of added parameters to sql statement. In SequenceDuringKeyGenerator I used that parameter size instead of count. It would be better if we check this logic against oracle engine. Regards, Ahmad
Hide
Ralf Joachim added a comment -

Executed tests against Oracle without failures.

Show
Ralf Joachim added a comment - Executed tests against Oracle without failures.
Hide
Ralf Joachim added a comment -

Patch commited as is. All enabled test pass against derby,mysql, postgresql and oracle.

Show
Ralf Joachim added a comment - Patch commited as is. All enabled test pass against derby,mysql, postgresql and oracle.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: