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

Add support for Embedded Objects #524

Open
ibrahim-mubarak opened this issue Mar 29, 2023 · 1 comment
Open

Add support for Embedded Objects #524

ibrahim-mubarak opened this issue Mar 29, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ibrahim-mubarak
Copy link

ibrahim-mubarak commented Mar 29, 2023

Describe the solution you'd like

@Entity()
class User {
  User(this.id, this.address);

 @Id
  final int id;

 @Embedded()
  final Address? address;
}

class Address {
 final String? streetAddress1;
 final String? streetAddress2
}

Database schema for User then becomes

id
street_address_1
street_address_2

Describe alternatives you've considered

The alternatives are as mentioned in objectbox/objectbox-java#456

Additional context

This request is similar to the features provided in other persistence libraries

@ibrahim-mubarak ibrahim-mubarak added the enhancement New feature or request label Mar 29, 2023
@greenrobot-team
Copy link
Member

Thanks for your request! For anyone else interested, please thumbs up the first post!

As noted objectbox/objectbox-java#456 is the Java issue about this.

And the current workarounds are to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants