問題タブ [joined-subclass]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
148 参照

c# - NHibernate内部または代替

私はNHibernateにかなり慣れていないので、拡張テーブルの2つの列が<joined-subclass>NHibernateマッピングに存在する必要があるという問題がありますが、適切な実装を見つけるのに最も苦労しています。

以下は私の実装の簡略化されたバージョンであり、最初に私が必要としているものを達成する方法だと思っていたものですが、NHibernate は a<join>内に a を許可しません<joined-subclass>

NHibernate の経験が豊富な人は、私が必要としているものを達成する方法を知っていますか?

私は最近、この NHibernate リソースをここで使用していますが、この苦境にあまり役立つとは証明されていません。

ヒントやリソースを教えていただければ幸いです。

ありがとうございました。

0 投票する
0 に答える
60 参照

hibernate - MappedSuperclass を拡張するクラスを指定する方法

以下に説明するクラス構造があります。

この構造は db 構造で表されます。
table B (id, revision); table C (id, dtype);

しかし、私はこのような構造にしたいと思います:
table B (id); table C (id, dtype, revision);

そのような振る舞いを定義することは可能ですか?

0 投票する
1 に答える
244 参照

hibernate - An issue when I use unidirectional One-To-Many and Table Per Class InheritanceType in Hibernate

I have a class Person and a class hierarchy which has three classes, when I use InheritanceType.TABLE_PER_CLASS for the class hierarchy, it got the "Batch update" problem. Please see the below code. AbstractBase is the base class for the class hierarchy.

Test code:

Output:

org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1"

I found that Hibernate doesn't update the Manager table when I went through the hibernate sql. When I changed the InheritanceType to InheritanceType.JOINED, the code works well. Do I miss something in the unidirectional One-To-Many configuration?

----------------------------------update--------------------------------

In 'Person' class, I changed @JoinColumn to @JoinTable in One-To-Many annotation, the testing code works well. Is there any missed configuration for @JoinColumn configuration when its target class is annotated by "InheritanceType.TABLE_PER_CLASS"?

See below detailed annotation:

-------------------------------------update--------------------------------

I tried the code with Hibernate 5.2.5 Final, the issue still exists.