I am using namedParameter to insert in table. lets say user table where active flag is defaulted to 1 in mysql and marked as NOT NULL.
What I want is if I have value for active I will set it through java code but if not I would set it null and expecting MySql to set the defaulted value but I get the exception
org.springframework.dao.InvalidDataAccessApiUsageException: No value supplied for the SQL parameter 'passwordType': No value registered for key 'active' at
How can I achieve desirable behavior?