Database new numeric field, initializing @Column annotations

Source: Internet
Author: User
When a new numeric field is added, the database default field value is null. This way, when a page with this field is accessed, a null pointer error is reported.
For example: critical [http-nio-80-exec-11] Org.apache.catalina.core.ApplicationDispatcher.invoke servlet.service () for Servlet JSP threw exception
Solution:

此种错误是由于jsp页面获得了一个空指针导致,即servlet传参数时有一个参数没穿过去或者传的参数和接受的参数不一致导致的,检查一下参数即可解决

I found out my mistake was that the value in the numeric field database is null and can only be manually changed to 0.br/> when the new field is first compiled run, on the Entity class new field, plus * * @Column annotations to identify the corresponding relationship between the attribute in the entity class and the field in the data table * *

@Column(name = "zyControlSec", columnDefinition = "int not NULL DEFAULT ((0)) ")

Database new numeric field, initializing @Column annotations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.