We have many customers data in separate databases per customer which should have the same schema/table structures. However there is a table that has extra columns in some databases compared to others.
For example for customer A there is a table X with columns a, b, c, d. For customer B there is a table X with columns a, c, d. I need to capture b if it exists but can ignore it if not.
Is there a way to tell JPA to ignore those columns if they don't exist? @Basic(optional=true)
reads exactly like what I want but the documentation indicates it is for another purpose.
Currently I get, as expected, Unknown column 'table.field' in 'field list'
P.S.
I can't just add the columns to the databases that don't have them unfortunately.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…