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 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:
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:
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?

