objectbox / objectbox/objectbox-dart

Add support for Embedded Objects

Open
#524 2 comments 30 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Dart
Stars
1.2k
Forks
162
Avg merge
15m
Merged PRs (30d)
1

Description

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 https://github.com/objectbox/objectbox-java/issues/456

Additional context

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files or tests are named in the issue. Start by reviewing the linked ObjectBox Java issue and the Room and Isar embedded-object references, then locate the Dart entity and schema-generation entry points. Done means the example model is supported and its User schema stores the embedded address fields as street_address_1 and street_address_2.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.