Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the Hibernate Annotation problem

Shulou Source: shulou.com Published: 2022-06-02 08:00:25 10月04日 Update

This article mainly introduces "how to solve the Hibernate Annotation problem". In the daily operation, I believe many people have doubts about how to solve the Hibernate Annotation problem. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "how to solve the Hibernate Annotation problem"! Next, please follow the editor to study!

In Hibernate Annotation, the annotations of entity BLOB and CLOB types are somewhat different from those of ordinary entity attributes. The specific operations are as follows: BLOB type, declared as byte []:

Private byte [] content

Notes:

@ Lob @ Basic (fetch = FetchType.LAZY) @ Column (name = "CONTENT", columnDefinition = "BLOB", nullable=true) public byte [] getContent () {return this.content;} public void setContent (byte [] content) {this.content = content;}

CLOB type, which can be declared as String:

Private String remark

Notes:

Lob @ Basic (fetch = FetchType.EAGER) @ Column (name= "REMARK", columnDefinition= "CLOB", nullable=true) public String getRemark () {return this.remark;} public void setRemark (String recvdocRemark) {this.remark = remark;}

Follow the notes above to set up the entity class and you are done.

At this point, the study on "how to solve the Hibernate Annotation problem" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Questions types annotations learning entities more help different practical ordinary next attributes articles methods theories knowledge articles websites materials follow Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology macOS Apple Redmi OPPO Reno