我想在 DB 上插入一個條目,該條目已填充所有字段,并且與另一個表/類具有 @ManyToOne 關系。為此,我正在調用entityManager.merge(c1),其中 myc1是一個Classification實例(根據下面的定義),我可以在日志中看到以下內容:[DEBUG] ...: c=o.h.SQL, m=logStatement, l=92, msg: insert into plat.classification_system (year, system, id) values (?, ?, ?)[TRACE] ...: c=o.h.t.d.s.BasicBinder, m=bind, l=65, msg: binding parameter [1] as [VARCHAR] - [2012][TRACE] ...: c=o.h.t.d.s.BasicBinder, m=bind, l=65, msg: binding parameter [2] as [BIGINT] - [1000001][TRACE] ...: c=o.h.t.d.s.BasicBinder, m=bind, l=65, msg: binding parameter [3] as [VARCHAR] - [main_system]......實際上我期待看到類似......[DEBUG] ...: c=o.h.SQL, m=logStatement, l=92, msg: insert into plat.classification_system (year, system, id, classification_type) values (?, ?, ?, ?)[TRACE] ...: c=o.h.t.d.s.BasicBinder, m=bind, l=65, msg: binding parameter [1] as [VARCHAR] - [2012][TRACE] ...: c=o.h.t.d.s.BasicBinder, m=bind, l=65, msg: binding parameter [2] as [BIGINT] - [1000001][TRACE] ...: c=o.h.t.d.s.BasicBinder, m=bind, l=65, msg: binding parameter [3] as [VARCHAR] - [main_system][TRACE] ...: c=o.h.t.d.s.BasicBinder, m=bind, l=65, msg: binding parameter [4] as [VARCHAR] - [abc]...代表以下模型: create table classification_system ( id number(19, 0) not null, year varchar2(255 char) not null, class_type_guid(48 char ) not null, system varchar2(255 char) not null, primary key (id) ) create table class_type ( guid (48 char) not null, code varchar2(255 char) not null, year varchar2(255 char) not null, system_type_guid varchar2(48 char) not null, primary key (guid) ) create table system_type ( guid (48 char ) not null, code varchar2(255 char) not null, year varchar2(255 char) not null, primary key (guid) )我一直在挖掘很多與@ManyToOne映射/關系相關的帖子,但還沒有找到任何我可以使用的東西。這是使用 Hibernate 5.0.9 構建的。有人可以幫我解決這個問題嗎?感謝您對此事的任何幫助。
添加回答
舉報
0/150
提交
取消