For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Tables from Java Classes

Create tables, zones, and indexes directly from Java POJOs using the GridGain 9 catalog API, with annotation-based and builder-based examples.

Overview

While SQL DDL supports a comprehensive set of table manipulation commands, you can also create tables and build indexes directly from a POJO using a simple Java API.

This API supports custom annotations and simple builders; it works seamlessly with the Mapper interface, thus facilitating KeyValueView and RecordView.

The Java examples on this page use the thin client, which requires the ignite-client module. For repository and dependency configuration, see Project Setup and Required Modules.

The Java API lets you perform the following operations:

  • CREATE ZONE

  • CREATE TABLE

  • CREATE INDEX

  • DROP ZONE

  • DROP TABLE

  • DROP INDEX

  • CREATE SCHEMA

  • DROP SCHEMA

Use the @Table and other annotations located in the org.apache.ignite.catalog.annotations package.

Examples

Key-Value POJO Compatible with KeyValueView

The example below creates a table called kv_pojo by using the POJO compatible with KeyValueView:

You need to create a storage profile in node configuration by using the CLI tool.

The result is equivalent to the following SQL multi-statement:

Single POJO Compatible with RecordView

The example below creates the pojo_sample table by using the POJO compatible with RecordView:

The Builder Alternative to the @Table Annotation

The example below uses a builder to create a table instead on creating it from a Java class:

When using builders, only the @Id and @Column annotations on fields are supported.

Next Steps

Once you have created a table using the Java API, you can manipulate it using the SQL commands.

See Also

This page is: Copyright © 2026 MariaDB. All rights reserved.

Last updated

Was this helpful?