我想为BOOLEAN类型设置默认值:
@Column(nullable = false, name = "is_activated", columnDefinition = "BOOLEAN DEFAULT FALSE")
private Boolean isActivated = false;
但是,运行服务器将抛出
Caused by: org.postgresql.util.PSQLException: ERROR: type "BOOLEAN DEFAULT FALSE" does not exist
Position: 121
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284) ~[postgresql-9.4.1208-jdbc42-atlassian-hosted.jar:9.4.1208]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003) ~[postgresql-9.4.1208-jdbc42-atlassian-hosted.jar:9.4.1208]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200) ~[postgresql-9.4.1208-jdbc42-atlassian-hosted.jar:9.4.1208]
我不知道为什么,因为我看到的其他例子就是这样做的。
为什么这不起作用?