Hi. I have made a Spring MVC form for creating a new Customer. Customer has an ID but also has a int value CustNumber which is also a primary key. I need to setup that every time when I open my customer form, in input field CustNumber, app generates next free value from column CustNumber in database.
I'm using just Spring MVC with Hibernate and I'm new in all of this, i just started learning Spring a week ago. I have my Customer controller, service, DAO, Customer class, my basic CRUD operations work. I just don't know how to use queries in Spring, raw queries that I used in Java. If somebody can help me to retrieve
next free CustNumber from database and automatically write it in input field CustNumber, I would be much grateful.