This document highlights the new features, improvements, and changes introduced in tinystruct version 1.7.23.
See also: What’s New in 1.7.19 for earlier features including HTTP method-specific actions, AI/MCP integration, and SSE support.
The framework now includes a fully automated POJO generator that creates Java classes and XML mapping files directly from your database schema. The generator intelligently detects column types and adds the necessary Java imports automatically — no manual package specification is required.
Supported Databases:
Usage:
# Interactive mode — prompts for table names and output path
bin/dispatcher generate
# Non-interactive — specify tables directly
bin/dispatcher generate --tables users
# Multiple tables at once (semicolon-delimited)
bin/dispatcher generate --tables "users;orders;products"
What It Generates:
For each table, the generator produces two files:
src/main/java/com/example/objects/User.javasrc/main/resources/com/example/objects/User.map.xmlThe generated classes extend AbstractData and integrate directly with tinystruct’s ORM, enabling immediate CRUD operations (append(), findOneById(), update(), delete()).
LocalDateTime SupportFull support for Java 8+ java.time.LocalDateTime has been integrated into the data hydration layer.
Field Mapping:
| SQL Column Type | Java Type | Automatic Import |
|---|---|---|
DATETIME, TIMESTAMP, DATETIME2 |
LocalDateTime |
java.time.LocalDateTime |
DATE |
Date |
java.util.Date |
TIMESTAMP (explicit) |
Timestamp |
java.sql.Timestamp |
TIME |
Time |
java.sql.Time |
Robust Hydration:
The FieldInfo utility now handles conversions from both java.sql.Timestamp objects and ISO-compliant strings, ensuring compatibility across different JDBC drivers and database vendors:
// In generated POJO setData() method
if(row.getFieldInfo("created_at") != null)
this.setCreatedAt(row.getFieldInfo("created_at").localDateTimeValue());
The generate command has been simplified by removing the interactive prompt for manual package imports. The generator now:
Before (1.7.19):
Please specify the table name(s):
Please specify the base path:
Please specify the packages to be imported: ← REMOVED
After (1.7.23):
Please specify the table name(s):
Please specify the base path:
The Generator interface has been streamlined by removing the importPackages() method. Import management is now fully internal to each generator implementation.
Before:
public interface Generator {
void setPath(String path);
void setPackageName(String packageName);
void importPackages(String packageNameList); // REMOVED
void create(String className, String table) throws ApplicationException;
}
After:
public interface Generator {
void setPath(String path);
void setPackageName(String packageName);
void create(String className, String table) throws ApplicationException;
}
All generators now use modern Java switch expressions for type-to-import resolution, replacing verbose if-else chains:
// Automatic imports based on propertyType
switch (propertyType) {
case "LocalDateTime" -> imports.add("java.time.LocalDateTime");
case "Date" -> imports.add("java.util.Date");
case "Timestamp" -> imports.add("java.sql.Timestamp");
case "Time" -> imports.add("java.sql.Time");
}
Imports are collected using a TreeSet, ensuring they are always unique and alphabetically sorted in the generated output:
import java.io.Serializable;
import java.time.LocalDateTime;
import org.tinystruct.data.component.AbstractData;
import org.tinystruct.data.component.Row;
Generator.importPackages() RemovedThe importPackages(String packageNameList) method has been removed from the Generator interface and all implementations. If your code directly calls this method on a generator instance, remove those calls — imports are now handled automatically.
<dependency>
<groupId>org.tinystruct</groupId>
<artifactId>tinystruct</artifactId>
<version>1.7.23</version>
</dependency>
// Old way — no longer needed
generator.importPackages("java.time.LocalDateTime;java.util.Date");
// New way — imports are automatic, just call create()
generator.create(className, tableName);
generate command no longer prompts for packages. Just provide your table names and output path.Version 1.7.23 focuses on developer experience by automating the POJO generation pipeline. The addition of native LocalDateTime support and automatic import detection means less manual configuration and fewer errors during code generation. The streamlined CLI workflow reduces the generation process to just two prompts, making it faster to go from database schema to working Java code.