java - Elegant way to handle upsert with Hibernate and MySQL -


i'm working on batch import feature sits on top of hibernate , mysql. goal have upsert functionality several tables. i'm finding myself writing lot of code deal seeing if row exists key , branching right method. wondering if there might better way, i.e. analogous tools come sql-server ssis hibernate , mysql. tools or elegant solutions have used handle bulk upserts hibernate and/or mysql?

you might mysql's on duplicate key update feature:

http://dev.mysql.com/doc/refman/5.1/en/insert-on-duplicate.html


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -