i'm learning Java hibernate, found an example of "insert ignore",
Query query = getSession().createSQLQuery("INSERT IGNORE INTO TABLA (ID, VAR) VALUES (:id, :var)");
UUID id = UUID.randomUUID();
query.setParameter("id", id);
String var = "abcde";
query.setParameter("var", var);
query.executeUpdate();
This will "insert ignore" 1 entry. I may have 100+ var as input, but only 1 or 2 will not be in the existing table, i don't know which ones.
If i set Parameters of 100 of values with a loop, it may work. But is there a better may ? given i may just need to insert 1 or 2 of them really.
Or i should ask this: given a list of 100 var string, find out the a few not in existing table, without using loop.