--- title: "NoSQLアイテムの構築" url: https://docs.catalyst.zoho.com/ja/sdk/java/v1/cloud-scale/nosql/construct-item/ description: "Catalyst NoSQLは、非リレーショナル、非SQLのデータストレージ手段を提供する完全マネージドの強力なデータベースです。このページでは、NoSQLアイテムを構築するSDKメソッドについて説明します。" last_updated: 2026-02-23T12:39:41Z service: Cloud Scale type: general related_links: - name: "NoSQL" url: /ja/cloud-scale/help/nosql/introduction - name: "Working with Data" url: /ja/cloud-scale/help/nosql/working-with-data/introduction/ - name: "NoSQL API" url: /ja/api/code-reference/cloud-scale/nosql/insert-item/#InsertNewItem --- # NoSQLアイテムの構築 [Catalyst NoSQL](https://docs.catalyst.zoho.com/ja/cloud-scale/help/nosql/introduction/)のアイテムは、レコードのような単一のデータポイントのデータを保持する属性のコレクションを表します。プロジェクト内の既存のNoSQLテーブルに[カスタムJSON形式](https://docs.catalyst.zoho.com/ja/cloud-scale/help/nosql/working-with-data/introduction/#the-catalyst-custom-json-format)で[アイテム](https://docs.catalyst.zoho.com/ja/cloud-scale/help/nosql/components/#basic-components)を挿入または更新できます。ただし、Catalystでアイテムを挿入または更新する前に、アイテムを構築する必要があります。 以下のセクションで説明するように、Catalystがサポートする異なるデータ型の属性を含むNoSQLアイテムを構築できます。CatalystはString、Number、Set of Strings、Set of Numbers、List、Mapなど、いくつかのデータ型をサポートしています。詳細については、共有リソースの[サポートされるデータ型](https://docs.catalyst.zoho.com/ja/cloud-scale/help/nosql/working-with-data/introduction/#supported-data-types)の完全なリストを参照してください。 テーブルに対して構成したパーティションキー属性の値を、すべてのデータアイテムで必ず提供する必要があります。テーブルキー、TTL属性、およびその他の詳細については、[テーブルキーのヘルプセクション](https://docs.catalyst.zoho.com/ja/cloud-scale/help/nosql/components/#table-keys)を参照してください。 ### 新しいNoSQLアイテムの作成 以下に示すように、`ZCNoSQLItem()`メソッドを使用して新しいNoSQLアイテムを作成できます。 ```java ZCNoSQLItem item = new ZCNoSQLItem(); ``` #### JSONまたはMapからの新しいNoSQLアイテムの作成 以下に示すように、プレーンJSONデータまたはMapを定義した後、そこから新しいNoSQLアイテムを作成できます。 ```java //public static ZCNoSQLItem fromJSON(String json) throws Exception; ZCNoSQLItem.fromJSON(<json string>); ``` ### 異なるデータ型のNoSQLアイテムの構築 以下のコードスニペットは、異なるデータ型の属性を持つアイテムを構築する形式を示しています: ```java //public ZCNoSQLItem withString(String attrName, String val) throws Exception; item.withString("attribute name", "<string value>"); //public ZCNoSQLItem withNumber(String attrName, BigDecimal val) throws Exception; //public ZCNoSQLItem withNumber(String attrName, Number val) throws Exception; item.withNumber("attribute name", "<numeric value>"); //public ZCNoSQLItem withInt(String attrName, int val) throws Exception; item.withInt("attribute name", "<integer value>"); //public ZCNoSQLItem withBigInteger(String attrName, BigInteger val) throws Exception; item.withBigInteger("attribute name", "<BigInt value>"); //public ZCNoSQLItem withShort(String attrName, short val) throws Exception; item.withShort("attribute name", "<Short value>"); //public ZCNoSQLItem withFloat(String attrName, float val) throws Exception; item.withFloat("attribute name", "<Float value>"); //public ZCNoSQLItem withDouble(String attrName, double val) throws Exception; item.withDouble("attribute name", "<Double value>"); //public ZCNoSQLItem withLong(String attrName, long val) throws Exception; item.withLong("attribute name", "<Long value>"); //public ZCNoSQLItem withBinary(String attrName, byte[] val) throws Exception; //public ZCNoSQLItem withBinary(String attrName, ByteBuffer val) throws Exception; item.withBinary("attribute name", "<Byte value>"); //public ZCNoSQLItem withStringSet(String attrName, Set<String> val) throws Exception; //public ZCNoSQLItem withStringSet(String attrName, String... val) throws Exception; item.withStringSet("attribute name", "<StringSet/String variadic param value>"); //public ZCNoSQLItem withBigDecimalSet(String attrName, Set<BigDecimal> val) throws Exception; //public ZCNoSQLItem withBigDecimalSet(String attrName, BigDecimal... vals) throws Exception; item.withBigDecimalSet("attribute name", "<DecimalSet/Decimal Variadic param value>"); //public <T extends Number> ZCNoSQLItem withNumberSet(String attrName, T... vals) throws Exception; //public <T extends Number> ZCNoSQLItem withNumberSet(String attrName, Set<T> vals) throws Exception; item.withNumberSet("attribute name", "<Numeric/Numeric Variadic param value>"); //public ZCNoSQLItem withBinarySet(String attrName, Set<byte[]> val) throws Exception; //public ZCNoSQLItem withBinarySet(String attrName, byte[]... vals) throws Exception; //public ZCNoSQLItem withBinarySet(String attrName, ByteBuffer... vals) throws Exception; item.withBinarySet("attribute name", "<Byte Set value>"); //public ZCNoSQLItem withByteBufferSet(String attrName, Set<ByteBuffer> val) throws Exception; item.withByteBufferSet("attribute name", "<Byte Set value>"); //public ZCNoSQLItem withList(String attrName, List<?> val) throws Exception; //public ZCNoSQLItem withList(String attrName, Object... vals) throws Exception; item.withList("attribute name", "<List/Variadic Param value>"); //public ZCNoSQLItem withMap(String attrName, Map<String, ?> val) throws Exception; item.withMap("attribute name", "<Map value>"); //public ZCNoSQLItem withJSON(String attrName, String json) throws Exception; item.withJSON("attribute name", "<JSON String value>"); //public ZCNoSQLItem withBoolean(String attrName, boolean val) throws Exception; item.withBoolean("attribute name", "<Boolean value>"); //public ZCNoSQLItem withNull(String attrName) throws Exception; item.withNull("attribute name"); //public ZCNoSQLItem with(String attrName, Object val) throws Exception; item.with("attribute name", "<Value>"); ```