takimafr / spring-dbunit

DBUnit support for Spring
Apache License 2.0
40 stars 19 forks source link

about support InsertIdentityOperation #40

Open hljklsgfag opened 9 years ago

hljklsgfag commented 9 years ago

I'm working on a project using Sybase. When I tried to use spring-dbunit, I run into a glitch, because the table has Identity columns, According to DBUnit FAQ(http://dbunit.sourceforge.net/components.html#InsertIdentityOperation), 'InsertIdentityOperation' should be used for the table.

I looked for a kind of com.excilys.ebi.spring.dbunit.config. DBOperation which uses 'InsertIdentityOperation', but I couldn't. Does spring-dbunit have some kind of DBOperation supports 'InsertIdentityOperation' ?

If you don't, should I revise DBOpeation.java like the below? If the codes aren't enough to fix the glitch, please let me know.

Step1 add below to DBOperation.

INSERT_IDENTITY_CLEAN_INSERT INSERT_IDENTITY_INSERT INSERT_IDENTITY_UPDATE INSERT_IDENTITY_REFRESH

Step2. add below codes to DBOperation#getDatabaseOperation method.

public DatabaseOperation getDatabaseOperation() { // for instance if (this == INSERT_IDENTITY_INSERT) { return InsertIdentityOperation.INSERT } // .. go on or

return DatabaseOperation.class.cast(operations.asObject(name()));

}

rsertelon commented 9 years ago

Just an update to let you know that I can't have a look right now. But will. Thanks for your patience. ;)

hljklsgfag commented 9 years ago

I'm sorry for my late reply, and thanks for your kindly reply. I'm looking forward to the update for it.