Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

@Embeddable の使用

Address クラスは @Embeddable アノテーションを使用して、生成する Caché クラスが Serial (または Embeddable) として定義されるように指定します。Caché では、シリアル・クラスのインスタンスをデータベースに単独で配置することはできません。他のオブジェクトの中に置く必要があります。例えば、Address のインスタンスは Contact のインスタンスの中に配置します。関連するコードは以下のとおりです。


package contacts;

import com.jalapeno.annotations.*;

@Access (type = AccessType.PROPERTY)
@Embeddable
public class Address{   

対応する Caché クラス定義の関連する部分は以下のとおりです。


Class contacts.Address Extends %Library.SerialObject [ ClassType = serial ]

Note:

Caché シリアル (または、埋め込み可能) オブジェクトの詳細は、"Caché オブジェクトの使用法" の "クラスの定義とコンパイル" のセクションで "クラスの種類" を参照してください。

FeedbackOpens in a new tab