Persistence @Column nullable = false can insert a null value

I want to make this column can't be null, but when I insert one register into the database, null, this allows me to insert. I read the documentation and I don't know why this is not working.  @Column(name="QWECOD", nullable = false) private String qwe;

THX

UPDATE: I am using Toplink and java org.eclipse.persistence.eclipselink: 2.4.2 .

+4
source share
2 answers

I think nullable is used if you create a schema using an entitymanager implementation. I do not know if it should / should be checked, while preserving the object.

, , @NotNull, JPA. JSR-303

Stackoverflow , : fooobar.com/questions/40968/...


EDIT: JPA 2.1 :

11.2.2.1
:



ColumnDefinition
( ) ( (/) ) ( (/) ) . 11.1.9 , . AttributeOverride .

, : JPA EntityManager , , DB (, notnull) , Entitymanager BUT, . , DB , EntityManager .

, NULL DB, entitymanager → persist - , , .

+5

, Hibernate . .

+2

All Articles