我在班上使用逆向工程并得到这个:
@Entity
@Table(name = "user", catalog = "bytecode", uniqueConstraints =
@UniqueConstraint(columnNames = "email"))
public class User implements java.io.Serializable {
private Integer id;
private String email;
private String password;
private boolean type;
Run Code Online (Sandbox Code Playgroud)
数据库:
CREATE TABLE `bytecode`.`user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`type` bit(1) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
Run Code Online (Sandbox Code Playgroud)
但是我不想在我的属性'type'中设置'true'或'false'但是1或0.我怎么能在hibernate中做到这一点?
此致,Valter Henrique.