Jpa ORMコース#5
2115 ワード
デフォルトのタイプ

Embedded
@Embeddededededededede:使用中に表示
@Embeddable:値を定義した場所に表示
->両方の中で1つだけ使ってもいいですが、どちらも使うことをお勧めします
DBの立場ではマッピングテーブルは同じ
設計されたORMアプリケーションのクラス数は、マッピングされたテーブル数よりも多くなります.




Entityを挿入することもできます

同じプロパティのEmbedded typeを使用する場合は、次の操作を行います。
@AttributeOverridesの使用

これで使えます.
値のタイプ
imbeddyタイプのような値を複数のエンティティで共有することは危険です.
ex) member2.getHomeAddress().setCity("newCity");
メンバー1がAddress embededtypeを共有している場合、メンバー1の値も変更されます.
新しいインスタンスを作成して使用する必要があります.
-->Embeded type=オブジェクトタイプ
member2.getHomeAddress().setCity("newCity");
オブジェクトの共有参照は避けられません。
だから
不変オブジェクト
値のタイプは、不変のオブジェクトに設定する必要があります.
IntegerとStringはJavaが提供する不変のオブジェクトであることに注意してください.
比較値のタイプ
参照値を比較する必要があります.
出力値:false

(既定値は)


Reference
この問題について(Jpa ORMコース#5), 我々は、より多くの情報をここで見つけました https://velog.io/@camel-man-ims/Jpa-ORM-강좌-5テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol