JoinColumns annotation insertable and updatable not working properly

453 views
Skip to first unread message

Kolya Denisenko

unread,
Nov 6, 2016, 12:32:15 PM11/6/16
to Ebean ORM
I am trying join two tables using compound key and have a problem there that ebean generate insert and update queries with several identical columns.
It seems that updatable and insertable not working for the case when one of columns shoud be updatable and another shouldn't:

@Entity
public class Image {
           .......

           @OneToOne
 @JoinColumns({
        @JoinColumn(name="post_id", referencedColumnName="id", updatable = true, insertable = true),
        @JoinColumn(name="collect_id", referencedColumnName="collect_id", updatable = false, insertable = false)
 })
private Post post;
 
          ........  
}

Rob Bygrave

unread,
Nov 16, 2016, 4:52:21 AM11/16/16
to ebean@googlegroups
Do you need the updatable = true, insertable = true in the above?

Can you expand this with some example code?


Thanks, Rob.

--

---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kolya Denisenko

unread,
Nov 18, 2016, 8:23:37 AM11/18/16
to Ebean ORM
In this case I need for column "collect_id" to be "updatable = false, insertable = false"
and for column "post_id" to be "updatable = true, insertable = true".
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages