When hibernate try to run this query to get the next Value from sequence
Query :- Query is: select next_val as id_val from my_sequence_table for update
I got this exception :-
Caused by:
java.sql.SQLException: Unknown column 'next_val' in 'field list'
while saving new entity with generation type = sequence iam double sure that sequence is exist in DB
I think this is hibernate issue as the next_val word in the query should be replaced with another true column name
the exception is fired on on the generator method of SequenceStyleGenerator class
@Override
public Serializable generate(final SharedSessionContractImplementor session, final Object object) throws HibernateException {
TaxClaimReference claimReference = (TaxClaimReference) object;
valuePrefix = claimReference.getRegisterReferencePrefix();
return valuePrefix + String.format(numberFormat, super.generate(session, object));
}