artmapper
Version:
Spring Boot clone for Node.js with TypeScript/JavaScript - JPA-like ORM, Lombok decorators, dependency injection, and MySQL support
86 lines • 2.83 kB
TypeScript
import 'reflect-metadata';
export declare const ENTITY_METADATA_KEY: unique symbol;
export declare const TABLE_METADATA_KEY: unique symbol;
export declare const COLUMN_METADATA_KEY: unique symbol;
export declare const ID_METADATA_KEY: unique symbol;
export declare const GENERATED_VALUE_METADATA_KEY: unique symbol;
export declare const ONE_TO_MANY_METADATA_KEY: unique symbol;
export declare const MANY_TO_ONE_METADATA_KEY: unique symbol;
export declare const MANY_TO_MANY_METADATA_KEY: unique symbol;
export declare const ONE_TO_ONE_METADATA_KEY: unique symbol;
export interface ColumnOptions {
name?: string;
type?: string;
nullable?: boolean;
unique?: boolean;
length?: number;
precision?: number;
scale?: number;
default?: any;
enum?: string[];
unsigned?: boolean;
zerofill?: boolean;
autoIncrement?: boolean;
comment?: string;
charset?: string;
collate?: string;
onUpdate?: string;
}
export interface GeneratedValueOptions {
strategy?: 'AUTO' | 'IDENTITY' | 'SEQUENCE' | 'UUID';
generator?: string;
}
export interface RelationOptions {
targetEntity?: () => Function;
cascade?: ('PERSIST' | 'MERGE' | 'REMOVE' | 'REFRESH' | 'ALL')[];
fetch?: 'EAGER' | 'LAZY';
mappedBy?: string;
joinColumn?: string | {
name?: string;
referencedColumnName?: string;
};
joinTable?: string | {
name?: string;
joinColumns?: any[];
inverseJoinColumns?: any[];
};
orphanRemoval?: boolean;
optional?: boolean;
}
/**
* Marks a class as a JPA entity
*/
export declare function Entity(name?: string): (target: Function) => void;
/**
* Specifies the table name for the entity
*/
export declare function Table(name: string): (target: Function) => void;
/**
* Marks a property as a database column
*/
export declare function Column(options?: ColumnOptions): (target: any, propertyKey: string) => void;
/**
* Marks a property as the primary key
*/
export declare function Id(): (target: any, propertyKey: string) => void;
/**
* Specifies generation strategy for primary key
*/
export declare function GeneratedValue(options?: GeneratedValueOptions): (target: any, propertyKey: string) => void;
/**
* One-to-many relationship
*/
export declare function OneToMany(options?: RelationOptions): (target: any, propertyKey: string) => void;
/**
* Many-to-one relationship
*/
export declare function ManyToOne(options?: RelationOptions): (target: any, propertyKey: string) => void;
/**
* Many-to-many relationship
*/
export declare function ManyToMany(options?: RelationOptions): (target: any, propertyKey: string) => void;
/**
* One-to-one relationship
*/
export declare function OneToOne(options?: RelationOptions): (target: any, propertyKey: string) => void;
//# sourceMappingURL=entity.d.ts.map