Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mapping): add support for embeddables #514

Merged
merged 1 commit into from Apr 26, 2020
Merged

feat(mapping): add support for embeddables #514

merged 1 commit into from Apr 26, 2020

Conversation

B4nan
Copy link
Member

@B4nan B4nan commented Apr 25, 2020

Embeddables are classes which are not entities themselves, but are embedded in entities.

@Embeddable()
class Address {

  @Property()
  street!: string;

  @Property()
  city!: string;

  @Property()
  country!: string;

}

@Entity()
class User {

  @PrimaryKey()
  id!: number;

  @Embedded(() => Address)
  address!: Address;

}

@lgtm-com
Copy link

lgtm-com bot commented Apr 26, 2020

This pull request introduces 1 alert when merging 24f507f into 4e80a9e - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@B4nan B4nan force-pushed the embeddables branch 4 times, most recently from eb45258 to 410a21b Compare April 26, 2020 21:18
Embeddables are classes which are not entities themselves, but are embedded in entities.

```typescript
@embeddable()
class Address {

  @Property()
  street!: string;

  @Property()
  city!: string;

  @Property()
  country!: string;

}

@entity()
class User {

  @PrimaryKey()
  id!: number;

  @Embedded(() => Address)
  address!: Address;

}
```
@B4nan B4nan merged commit ff897e4 into dev Apr 26, 2020
@B4nan B4nan deleted the embeddables branch April 26, 2020 21:28
@B4nan B4nan mentioned this pull request Apr 27, 2020
B4nan added a commit that referenced this pull request Apr 29, 2020
Embeddables are classes which are not entities themselves, but are embedded in entities.

```typescript
@embeddable()
class Address {

  @Property()
  street!: string;

  @Property()
  city!: string;

  @Property()
  country!: string;

}

@entity()
class User {

  @PrimaryKey()
  id!: number;

  @Embedded(() => Address)
  address!: Address;

}
```
@B4nan B4nan mentioned this pull request Apr 30, 2020
46 tasks
B4nan added a commit that referenced this pull request May 3, 2020
Embeddables are classes which are not entities themselves, but are embedded in entities.

```typescript
@embeddable()
class Address {

  @Property()
  street!: string;

  @Property()
  city!: string;

  @Property()
  country!: string;

}

@entity()
class User {

  @PrimaryKey()
  id!: number;

  @Embedded(() => Address)
  address!: Address;

}
```
@murbanowicz
Copy link

Does it work with all dB? I mean pg and mongodb as well?

@B4nan
Copy link
Member Author

B4nan commented May 20, 2020

B4nan added a commit that referenced this pull request May 21, 2020
Embeddables are classes which are not entities themselves, but are embedded in entities.

```typescript
@embeddable()
class Address {

  @Property()
  street!: string;

  @Property()
  city!: string;

  @Property()
  country!: string;

}

@entity()
class User {

  @PrimaryKey()
  id!: number;

  @Embedded(() => Address)
  address!: Address;

}
```
B4nan added a commit that referenced this pull request Jun 1, 2020
Embeddables are classes which are not entities themselves, but are embedded in entities.

```typescript
@embeddable()
class Address {

  @Property()
  street!: string;

  @Property()
  city!: string;

  @Property()
  country!: string;

}

@entity()
class User {

  @PrimaryKey()
  id!: number;

  @Embedded(() => Address)
  address!: Address;

}
```
B4nan added a commit that referenced this pull request Jun 5, 2020
Embeddables are classes which are not entities themselves, but are embedded in entities.

```typescript
@embeddable()
class Address {

  @Property()
  street!: string;

  @Property()
  city!: string;

  @Property()
  country!: string;

}

@entity()
class User {

  @PrimaryKey()
  id!: number;

  @Embedded(() => Address)
  address!: Address;

}
```
B4nan added a commit that referenced this pull request Jun 16, 2020
Embeddables are classes which are not entities themselves, but are embedded in entities.

```typescript
@embeddable()
class Address {

  @Property()
  street!: string;

  @Property()
  city!: string;

  @Property()
  country!: string;

}

@entity()
class User {

  @PrimaryKey()
  id!: number;

  @Embedded(() => Address)
  address!: Address;

}
```
B4nan added a commit that referenced this pull request Aug 2, 2020
Embeddables are classes which are not entities themselves, but are embedded in entities.

```typescript
@embeddable()
class Address {

  @Property()
  street!: string;

  @Property()
  city!: string;

  @Property()
  country!: string;

}

@entity()
class User {

  @PrimaryKey()
  id!: number;

  @Embedded(() => Address)
  address!: Address;

}
```
B4nan added a commit that referenced this pull request Aug 9, 2020
Embeddables are classes which are not entities themselves, but are embedded in entities.

```typescript
@embeddable()
class Address {

  @Property()
  street!: string;

  @Property()
  city!: string;

  @Property()
  country!: string;

}

@entity()
class User {

  @PrimaryKey()
  id!: number;

  @Embedded(() => Address)
  address!: Address;

}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants