You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "roger.keays" <ro...@ninthavenue.com.au> on 2008/05/20 02:48:07 UTC

1.1.0-SNAPSHOT: insert skipped when no columns to be set

Hi All,

Given an entity like

Class A {
  @Id @GeneratedValue(strategy=IDENTITY)
  Long id;

  @OneToMany(mappedBy="somefield")
  List<Thing> things;
}

If you try to persist it, no insert happens, because the row doesn't
actually have any data in it. Although, if you add a string field with a
value the insert does occur.

Has anybody else noticed this?

Cheers,

Roger
-- 
View this message in context: http://www.nabble.com/1.1.0-SNAPSHOT%3A-insert-skipped-when-no-columns-to-be-set-tp17331076p17331076.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.


Re: 1.1.0-SNAPSHOT: insert skipped when no columns to be set

Posted by Patrick Linskey <pl...@gmail.com>.
Hi,

Yeah, I think I've seen that behavior before. What happens if you add  
a version column?

-Patrick

On May 19, 2008, at 5:48 PM, roger.keays wrote:

>
> Hi All,
>
> Given an entity like
>
> Class A {
>  @Id @GeneratedValue(strategy=IDENTITY)
>  Long id;
>
>  @OneToMany(mappedBy="somefield")
>  List<Thing> things;
> }
>
> If you try to persist it, no insert happens, because the row doesn't
> actually have any data in it. Although, if you add a string field  
> with a
> value the insert does occur.
>
> Has anybody else noticed this?
>
> Cheers,
>
> Roger
> -- 
> View this message in context: http://www.nabble.com/1.1.0-SNAPSHOT%3A-insert-skipped-when-no-columns-to-be-set-tp17331076p17331076.html
> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
>

-- 
Patrick Linskey
202 669 5907