tag:blogger.com,1999:blog-25223681.post8762341767332377735..comments2021-10-13T05:02:38.305-05:00Comments on The eye sees only what the mind is prepared to comprehend: JPA Myth: EclipseLink and Hibernate are compatible. Not true: Hibernate does NOT follow the JPA SpecLuxspeshttp://www.blogger.com/profile/16636706720254040664noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-25223681.post-40156739415204260532009-12-01T11:58:16.375-06:002009-12-01T11:58:16.375-06:00Eclipse and Hibernate are poster children for Open...Eclipse and Hibernate are poster children for Open Source. Many developers want to integrate the two of them, and James Elliott has written on this topic. James discusses the myriad of Eclipse plugins available for Hibernate, how to set them up, and how they work.<br /><br /><a href="http://www.vitabits.de/gesundheit-des-mannes" rel="nofollow">nahrungsergänzung</a>Sara Reidhttps://www.blogger.com/profile/18373862159812719999noreply@blogger.comtag:blogger.com,1999:blog-25223681.post-87779448975447351562009-11-13T11:01:59.445-06:002009-11-13T11:01:59.445-06:00I mean, of course I like the fact that now I can t...I mean, of course I like the fact that now I can turn off org.hibernate.engine.Nullability.checkNullability, but... I think using optional=true for this would have given it a purpose... now it is IMO even more redundant (and useless?)Luxspeshttps://www.blogger.com/profile/16636706720254040664noreply@blogger.comtag:blogger.com,1999:blog-25223681.post-43853005232566366162009-11-13T10:50:02.338-06:002009-11-13T10:50:02.338-06:00Ok,but.. hmmmm, is the spec clear now? Because if ...Ok,but.. hmmmm, is the spec clear now? Because if what Gavin said is accurate (<i>that the spec says that nullable=true was only a schema generation hint and optional=true was for object level validation</i>) then why did you add a general configuration flag instead of making it possible to use "optional=true and nullable=false" to disable org.hibernate.engine.Nullability.checkNullability individualy?Luxspeshttps://www.blogger.com/profile/16636706720254040664noreply@blogger.comtag:blogger.com,1999:blog-25223681.post-71581570688678349932009-11-13T10:28:35.562-06:002009-11-13T10:28:35.562-06:00Frankly at the time the spec was a bit unclear and...Frankly at the time the spec was a bit unclear and it was not wo risk to disable the in memory null checking in Hibernate. <br />Hence my decision from a few years back.Anonymoushttps://www.blogger.com/profile/12946048387636548675noreply@blogger.comtag:blogger.com,1999:blog-25223681.post-87353244989654412752009-11-13T09:58:43.234-06:002009-11-13T09:58:43.234-06:00Hi Emmanuel!
All I wanted with that example was t...Hi Emmanuel!<br /><br />All I wanted with that example was to find a way to turn off org.hibernate.engine.Nullability.checkNullability. Gavin said that nullable=true was only a schema generation hint and optional=true was for object level validation, based on that I thought then: "optional=true and nullable=false" should "turn off" org.hibernate.engine.Nullability.checkNullability (<i>optional=true</i>) but keep the field as null in the database (<i>nullable=false</i>).<br /><br />Shouldnt it have that effect?Luxspeshttps://www.blogger.com/profile/16636706720254040664noreply@blogger.comtag:blogger.com,1999:blog-25223681.post-3758320382124536402009-11-13T09:03:04.663-06:002009-11-13T09:03:04.663-06:00I've fixed this recently when integrating Bean...I've fixed this recently when integrating Bean Validation and Hibernate. HHH-3898<br />Thata being said, I don't see much reason to have optional=true and nullable=false as your example shows. <br />It does not seem to make much sense.Anonymoushttps://www.blogger.com/profile/12946048387636548675noreply@blogger.comtag:blogger.com,1999:blog-25223681.post-44444509905686311262009-11-07T17:33:49.627-06:002009-11-07T17:33:49.627-06:00Hmmm, in hear your frustration.
The flags are pri...Hmmm, in hear your frustration.<br /><br />The flags are primative boolean for both @Basic.optional and @Column.nullable ... so if you do have both there is definately a chance for setting them inconsistently (as you have pointed out).<br /><br />I don't think this is explicit in the JPA spec so you could try the JPA spec emailing list as an option.<br /><br />For what it's worth I've just looked at this for Ebean ORM and ... instead think it better that if either one is effectively nullable=true ... then that is what is used (aka implying that someone changed it from the default value explicitly). Then the DDL and persist behaviour is consistent.<br /><br />Note that this sort of issue will also occur with the new Bean Validation annotations. My current thinking is that if there is a @NotNull that should be equivilent to setting nullable=false.<br /><br />Good luck anyway :)<br /><br />Cheers, Rob.<br />Ebean ORM - http://www.avaje.orgRobhttps://www.blogger.com/profile/15681828713730105495noreply@blogger.com