我想在 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
提交
取消