Skip to content

How to generate entity classes with MySQL request? #21

@MarErm27

Description

@MarErm27

Hello, here is a MySQL script below. Can Telesys-cli create classes with Hibernate annotations based on this script? How to launch it during the build of the Java Maven project?

CREATE TABLE IF NOT EXISTS orders (
    order_id INT PRIMARY KEY,
    order_number VARCHAR(128),
    order_data  VARCHAR(4096),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at  TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=INNODB;

CREATE TABLE IF NOT EXISTS invoices (
	invoice_id INT PRIMARY KEY,
        order_id INT UNIQUE,
	INDEX ord_id (order_id),
        FOREIGN KEY (order_id)
		REFERENCES orders(order_id)
                ON DELETE CASCADE,    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at  TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=INNODB;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions