简体   繁体   中英

Differerence between hibernate types: boolean, yes_no, true_false

When to use each? To what do they map in the database?

from Hibernate: http://docs.jboss.org/hibernate/stable/core.old/reference/en/html_single/#mapping-types-basictypes

boolean , yes_no and true_false are all alternative encodings for a Java boolean or java.lang.Boolean.

Follow true_false , if you like T / F at database level. Otherwise, use yes_no , it will give you Y / N in the database.

By the way, got to know that there are some issues with these, which result in unexpected value. For example here and here , Few seems fixed already in successive updates, though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM