public InsertMeta(DatabasePlatform dbPlatform, BeanDescriptor<?> desc, Bindable shadowFKey, BindableId id, Bindable all) { this.emptyStringToNull = dbPlatform.isTreatEmptyStringsAsNull(); this.tableName = desc.getBaseTable(); this.discriminator = getDiscriminator(desc); this.id = id; this.all = all; this.shadowFKey = shadowFKey; this.sqlWithId = genSql(false, null); // only available for single Id property if (id.isConcatenated()) { // concatenated key this.concatinatedKey = true; this.identityDbColumns = null; this.sqlNullId = null; this.supportsGetGeneratedKeys = false; this.selectLastInsertedId = null; } else { // insert sql for db identity or sequence insert this.concatinatedKey = false; this.identityDbColumns = new String[]{id.getIdentityColumn()}; this.sqlNullId = genSql(true, null); this.supportsGetGeneratedKeys = dbPlatform.getDbIdentity().isSupportsGetGeneratedKeys(); this.selectLastInsertedId = desc.getSelectLastInsertedId(); } }
public InsertMeta(DatabasePlatform dbPlatform, BeanDescriptor<?> desc, Bindable shadowFKey, BindableId id, Bindable all) { this.emptyStringToNull = dbPlatform.isTreatEmptyStringsAsNull(); this.tableName = desc.getBaseTable(); this.discriminator = getDiscriminator(desc); this.id = id; this.all = all; this.shadowFKey = shadowFKey; this.sqlWithId = genSql(false, null); // only available for single Id property if (id.isConcatenated()) { // concatenated key this.concatinatedKey = true; this.identityDbColumns = null; this.sqlNullId = null; this.supportsGetGeneratedKeys = false; this.selectLastInsertedId = null; } else { // insert sql for db identity or sequence insert this.concatinatedKey = false; this.identityDbColumns = new String[]{id.getIdentityColumn()}; this.sqlNullId = genSql(true, null); this.supportsGetGeneratedKeys = dbPlatform.getDbIdentity().isSupportsGetGeneratedKeys(); this.selectLastInsertedId = desc.getSelectLastInsertedId(); } }
} else { this.identityDbColumns = new String[]{id.getIdentityColumn()}; this.supportsGetGeneratedKeys = dbPlatform.getDbIdentity().isSupportsGetGeneratedKeys(); this.selectLastInsertedId = desc.getSelectLastInsertedId();