java - Ebean ManyToOne nullable join -
i have 2 models :
@entity @table(name="table_entry") public class tableentry extends model { @manytoone(fetch=fetchtype.lazy) @joincolumn(name="clone_id", referencedcolumnname="clone_id") public genedata gene_data; @id @generatedvalue(strategy = generationtype.identity) public long id; @constraints.required public string strain; public string clone_id; public string exp_type; ...
and
@entity @table(name="gene_data") public class genedata extends model { @id @generatedvalue(strategy = generationtype.identity) public long id; @manytoone public list<tableentry> entry; public string clone_id; public string gene_name; public string wb_id; ...
i join table_entry
on clone_id
. however, not every row in table_entry
has row in gene_data
. want gene_data
null when not found during join. possible?
what doing wrong? keep getting error
we got following error: referential integrity constraint violation: "fk_table_entry_gene_data_1: public.table_entry foreign key(clone_id) references public.gene_data(clone_id) ('y56a3a.19')";
i think there row in table_entry clone_id set 'y56a3a.19' there isn't row in gene_data value.
Comments
Post a Comment