Hi Lukas,
I am designing a DB where I have the columns below.

There is a nightly build which is basically pulling data from another system and entering records to this DB. I am doing a batch insert of records.
public boolean createTopicPages(List<TopicPage> topicPages) {
List<TopicPageRecord> topicPageRecords = new ArrayList<>(topicPages.size());
topicPages.stream().forEach(topicPage -> {
TopicPageRecord topicPageRecord = new TopicPageRecord();
topicPageRecord.setTaxonomyId(topicPage.getTaxonomyId());
topicPageRecord.setCmsName(topicPage.getCmsName());
topicPageRecord.setSubject(topicPage.getSubject());
topicPageRecord.setClassification(topicPage.getClassification());
topicPageRecord.setEntryName(topicPage.getEntryName());
topicPageRecord.setStatus(topicPage.getStatus());
topicPageRecord.setEntryUpdated(topicPage.getEntryUpdated());
topicPageRecord.setEntryPublished(topicPage.getEntryPublished());
topicPageRecords.add(topicPageRecord);
});
int[] execute = dsl.batchInsert(topicPageRecords).execute();
return execute.length > 0;
}
Now the problem is, when every time pull records and trying to entry in the DB , there will be already exiting entries already in the DB. And I have made cms_name & entry_name column as unique. So it is breaking when I am trying to enter the records which are already in the DB due to the uniqueness.
My requirement is I should ignore the records, if there is no change to entry_updated OR status value. How can I achieve that using Jooq query and how to design my query. If you have any sample reference for such kind of requirements please pass me here.
Thanks,
Deba