mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
small fixes
This commit is contained in:
parent
a89f4a4b11
commit
a80cf96322
@ -1,5 +1,5 @@
|
||||
import {Column} from "../../../src/decorator/columns/Column";
|
||||
import {TableInheritance} from "../../../src/decorator/TableInheritance";
|
||||
import {TableInheritance} from "../../../src/decorator/tables/TableInheritance";
|
||||
import {DiscriminatorColumn} from "../../../src/decorator/columns/DiscriminatorColumn";
|
||||
import {Table} from "../../../src/decorator/tables/Table";
|
||||
import {PrimaryColumn} from "../../../src/decorator/columns/PrimaryColumn";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {Column} from "../../../src/decorator/columns/Column";
|
||||
import {TableInheritance} from "../../../src/decorator/TableInheritance";
|
||||
import {TableInheritance} from "../../../src/decorator/tables/TableInheritance";
|
||||
import {DiscriminatorColumn} from "../../../src/decorator/columns/DiscriminatorColumn";
|
||||
import {Table} from "../../../src/decorator/tables/Table";
|
||||
import {PrimaryColumn} from "../../../src/decorator/columns/PrimaryColumn";
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import {EntityEventSubscriber} from "../../../src/decorator/listeners/EventSubscriber";
|
||||
import {EventSubscriber} from "../../../src/decorator/listeners/EventSubscriber";
|
||||
import {EntitySubscriberInterface} from "../../../src/subscriber/EntitySubscriberInterface";
|
||||
import {InsertEvent} from "../../../src/subscriber/event/InsertEvent";
|
||||
import {RemoveEvent} from "../../../src/subscriber/event/RemoveEvent";
|
||||
import {UpdateEvent} from "../../../src/subscriber/event/UpdateEvent";
|
||||
|
||||
@EntityEventSubscriber()
|
||||
@EventSubscriber()
|
||||
export class EverythingSubscriber implements EntitySubscriberInterface<any> {
|
||||
|
||||
/**
|
||||
|
||||
@ -2,6 +2,8 @@ import {getMetadataArgsStorage} from "../index";
|
||||
import {DiscriminatorValueMetadataArgs} from "../metadata-args/DiscriminatorValueMetadataArgs";
|
||||
|
||||
/**
|
||||
* If entity is a child table of some table, it should have a discriminator value.
|
||||
* This decorator sets custom discriminator value for the entity.
|
||||
*/
|
||||
export function DiscriminatorValue(value: any): Function {
|
||||
return function (target: Function) {
|
||||
|
||||
@ -5,7 +5,7 @@ import {EntitySubscriberMetadataArgs} from "../../metadata-args/EntitySubscriber
|
||||
* Classes decorated with this decorator will listen to ORM events and their methods will be triggered when event
|
||||
* occurs. Those classes must implement EventSubscriberInterface interface.
|
||||
*/
|
||||
export function EntityEventSubscriber() {
|
||||
export function EventSubscriber() {
|
||||
return function (target: Function) {
|
||||
const args: EntitySubscriberMetadataArgs = {
|
||||
target: target
|
||||
|
||||
@ -3,6 +3,9 @@ import {JoinColumnOptions} from "../options/JoinColumnOptions";
|
||||
import {JoinColumnMetadataArgs} from "../../metadata-args/JoinColumnMetadataArgs";
|
||||
|
||||
/**
|
||||
* JoinColumn decorator used on one-to-one relations to specify owner side of relationship.
|
||||
* It also can be used on both one-to-one and many-to-one relations to specify custom column name
|
||||
* or custom referenced column.
|
||||
*/
|
||||
export function JoinColumn(options?: JoinColumnOptions): Function {
|
||||
return function (object: Object, propertyName: string) {
|
||||
|
||||
@ -3,6 +3,8 @@ import {JoinTableOptions} from "../options/JoinTableOptions";
|
||||
import {JoinTableMetadataArgs} from "../../metadata-args/JoinTableMetadataArgs";
|
||||
|
||||
/**
|
||||
* JoinTable decorator is used in many-to-many relationship to specify owner side of relationship.
|
||||
* Its also used to set a custom junction table's name, column names and referenced columns.
|
||||
*/
|
||||
export function JoinTable(options?: JoinTableOptions): Function {
|
||||
return function (object: Object, propertyName: string) {
|
||||
|
||||
@ -2,6 +2,7 @@ import {getMetadataArgsStorage} from "../../index";
|
||||
import {RelationIdMetadataArgs} from "../../metadata-args/RelationIdMetadataArgs";
|
||||
|
||||
/**
|
||||
* Special decorator used to extract relation id into separate entity property.
|
||||
*/
|
||||
export function RelationId<T>(relation: string|((object: T) => any)): Function {
|
||||
return function (object: Object, propertyName: string) {
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import {getMetadataArgsStorage} from "../index";
|
||||
import {InheritanceMetadataArgs} from "../metadata-args/InheritanceMetadataArgs";
|
||||
import {getMetadataArgsStorage} from "../../index";
|
||||
import {InheritanceMetadataArgs} from "../../metadata-args/InheritanceMetadataArgs";
|
||||
|
||||
/**
|
||||
* Sets what kind of table-inheritance table will use.
|
||||
*/
|
||||
export function TableInheritance(type: "single-table"|"class-table") {
|
||||
return function (target: Function) {
|
||||
@ -54,7 +54,7 @@ export * from "./decorator/tree/TreeLevelColumn";
|
||||
export * from "./decorator/tree/TreeParent";
|
||||
export * from "./decorator/Index";
|
||||
export * from "./decorator/NamingStrategy";
|
||||
export * from "./decorator/TableInheritance";
|
||||
export * from "./decorator/tables/TableInheritance";
|
||||
export * from "./decorator/Embedded";
|
||||
export * from "./decorator/DiscriminatorValue";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Arguments for DiscriminatorNameMetadata class.
|
||||
* DiscriminatorValue properties.
|
||||
*/
|
||||
export interface DiscriminatorValueMetadataArgs {
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import {EntityEventSubscriber} from "../../../../../../src/decorator/listeners/EventSubscriber";
|
||||
import {EventSubscriber} from "../../../../../../src/decorator/listeners/EventSubscriber";
|
||||
import {EntitySubscriberInterface} from "../../../../../../src/subscriber/EntitySubscriberInterface";
|
||||
import {InsertEvent} from "../../../../../../src/subscriber/event/InsertEvent";
|
||||
|
||||
@EntityEventSubscriber()
|
||||
@EventSubscriber()
|
||||
export class TestBlogSubscriber implements EntitySubscriberInterface<any> {
|
||||
|
||||
/**
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import {EntityEventSubscriber} from "../../../../../../src/decorator/listeners/EventSubscriber";
|
||||
import {EventSubscriber} from "../../../../../../src/decorator/listeners/EventSubscriber";
|
||||
import {EntitySubscriberInterface} from "../../../../../../src/subscriber/EntitySubscriberInterface";
|
||||
import {InsertEvent} from "../../../../../../src/subscriber/event/InsertEvent";
|
||||
|
||||
@EntityEventSubscriber()
|
||||
@EventSubscriber()
|
||||
export class TestQuestionSubscriber implements EntitySubscriberInterface<any> {
|
||||
|
||||
/**
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import {EntityEventSubscriber} from "../../../../../../src/decorator/listeners/EventSubscriber";
|
||||
import {EventSubscriber} from "../../../../../../src/decorator/listeners/EventSubscriber";
|
||||
import {EntitySubscriberInterface} from "../../../../../../src/subscriber/EntitySubscriberInterface";
|
||||
import {InsertEvent} from "../../../../../../src/subscriber/event/InsertEvent";
|
||||
|
||||
@EntityEventSubscriber()
|
||||
@EventSubscriber()
|
||||
export class TestVideoSubscriber implements EntitySubscriberInterface<any> {
|
||||
|
||||
/**
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import {EntitySubscriberInterface} from "../../../../src/subscriber/EntitySubscriberInterface";
|
||||
import {EntityEventSubscriber} from "../../../../src/decorator/listeners/EventSubscriber";
|
||||
import {EventSubscriber} from "../../../../src/decorator/listeners/EventSubscriber";
|
||||
import {InsertEvent} from "../../../../src/subscriber/event/InsertEvent";
|
||||
|
||||
@EntityEventSubscriber()
|
||||
@EventSubscriber()
|
||||
export class FirstConnectionSubscriber implements EntitySubscriberInterface<any> {
|
||||
|
||||
/**
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import {EntitySubscriberInterface} from "../../../../src/subscriber/EntitySubscriberInterface";
|
||||
import {EntityEventSubscriber} from "../../../../src/decorator/listeners/EventSubscriber";
|
||||
import {EventSubscriber} from "../../../../src/decorator/listeners/EventSubscriber";
|
||||
import {InsertEvent} from "../../../../src/subscriber/event/InsertEvent";
|
||||
|
||||
@EntityEventSubscriber()
|
||||
@EventSubscriber()
|
||||
export class SecondConnectionSubscriber implements EntitySubscriberInterface<any> {
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user