0

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));
    }
2
  • Is this the same as CONJ-1076?
    – danblack
    Sep 1, 2023 at 8:01
  • yes iam using mariaDB 11 , i think so it is the same @danblack
    – omarAhmed
    Sep 1, 2023 at 13:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.