gen-jhipster
Version:
Spring Boot + Angular/React/Vue in one handy generator
61 lines (50 loc) • 1.85 kB
TypeScript
import type { Entity as BaseEntity } from '../base/entity.js';
import type { Relationship as BaseRelationship } from '../base/relationship.js';
import type { DerivedPropertiesOnlyOf } from '../utils/derived-properties.js';
import type { Entity } from './entity.js';
import type { Property } from './property.js';
type RelationshipProperties = DerivedPropertiesOnlyOf<
'relationship',
'LeftSide' | 'RightSide' | 'ManyToOne' | 'OneToMany' | 'OneToOne' | 'ManyToMany'
>;
export interface Relationship<E extends BaseEntity = Entity> extends BaseRelationship, Property, RelationshipProperties, VauthzRelationship, GrpcRelationship {
propertyName: string;
relationshipNameCapitalized: string;
otherEntity: E;
otherRelationship: Relationship<Omit<Entity, 'relationships'>>;
collection: boolean;
skipClient?: boolean;
skipServer?: boolean;
/**
* A persistable relationship means that the relationship will be updated in the database.
*/
persistableRelationship: boolean;
id?: boolean;
ownerSide?: boolean;
relationshipEagerLoad?: boolean;
relationshipRequired?: boolean;
propertyJavaBeanName?: string;
propertyDtoJavaType?: string;
onDelete?: boolean;
onUpdate?: boolean;
/* TODO check motivation */
relationshipSqlSafeName?: string;
relationshipJavadoc?: string;
relationshipApiDescription?: string;
columnDataType?: string;
}
export interface VauthzRelationship {
vauthzRelationshipName: string;
isBidirectionalVauthzRelationship: boolean;
isSubject: boolean;
}
export interface GrpcRelationship {
otherEntityProtobufFile: string;
otherEntityProtoMapper: string;
otherEntityTest: string;
otherEntityProtobufType: string;
otherEntityNameCapitalized: string;
otherEntityFieldUnderscored: string;
relationshipNameUnderscored: string;
otherEntityNameUnderscored: string;
}