openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Stultz <da...@6degrees.com>
Subject Re: Nullable unique constraints
Date Tue, 30 Jun 2009 13:29:52 GMT
On Mon, Jun 29, 2009 at 8:00 PM, Adam Hardy <adam.sql@cyberspaceroad.com>wrote:

>
> Also try insertable=false updatable=false
>

When I add this, I no longer get the insert of 0 for null. I also get null
for everything. As the property name suggests, it doesn't get updated or
inserted. According to the docs:


>    -
>
>    boolean insertable: By setting this property to false, you can omit the
>    column from SQL INSERT statements. Defaults to true.
>    -
>
>     boolean updatable: By setting this property to false, you can omit the
>    column from SQL UPDATE statements. Defaults to true.
>
> This doesn't make any sense. Who is "you"? As a user of JPA, I don't create
SQL statements myself. What does "you can omit" mean? If I feel like it? It
doesn't seem like this is related to my problem.

>
> and set the openjpa property
> openjpa.jdbc.SchemaFactory=native(ForeignKeys=true)


This appears to be a good development practice to ensure my database schema
is correct. It doesn't actually change the behavior, right? It didn't cause
any exceptions, I don't think.

Does anybody have an example they can share of a unique nullable field? It
doesn't have to be a foreign key, I'm having trouble with a String field as
well.



-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:daryl@6degrees.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message