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 #328

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

hsul4n
Copy link

@hsul4n hsul4n commented May 12, 2020

Here's an implementation for @Embedded annotation with test and example.

Closing #9

@hsul4n
Copy link
Author

hsul4n commented May 12, 2020

Is there any issue with testing nullable boolean

@vitusortner
Copy link
Collaborator

Thanks for your contribution! I'll look into it as soon as possible.

@hsul4n
Copy link
Author

hsul4n commented May 13, 2020

@vitusortner sorry for unnecessary commits, checkout the new clarified commits.

@mqus mqus linked an issue May 13, 2020 that may be closed by this pull request
@hsul4n
Copy link
Author

hsul4n commented May 14, 2020

Rebasing develop branch to get the latest commit #327

@hsul4n hsul4n mentioned this pull request May 14, 2020
Copy link
Collaborator

@vitusortner vitusortner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left some questions. Thanks for your initiative in starting this non-trivial task!

floor_generator/lib/processor/queryable_processor.dart Outdated Show resolved Hide resolved
floor_generator/lib/processor/queryable_processor.dart Outdated Show resolved Hide resolved
floor_generator/lib/processor/queryable_processor.dart Outdated Show resolved Hide resolved
floor_generator/lib/processor/embedded_processor.dart Outdated Show resolved Hide resolved
floor_generator/lib/value_object/embedded.dart Outdated Show resolved Hide resolved
floor_generator/lib/value_object/entity.dart Show resolved Hide resolved
floor_generator/lib/value_object/entity.dart Outdated Show resolved Hide resolved
@hsul4n
Copy link
Author

hsul4n commented May 16, 2020

Thanks, @vitusortner for catching gaps, I'll try to follow the suggestions and also provide better testing.

@hsul4n hsul4n changed the title Add support for embedded Add support for embedded objects May 27, 2020
@hsul4n
Copy link
Author

hsul4n commented May 27, 2020

I've left some questions. Thanks for your initiative in starting this non-trivial task!

Resolved with 292cfb4, will update CHANGELOG.md, README.md & version after approving changes.

@hsul4n hsul4n requested a review from vitusortner May 27, 2020 23:28
- Use prefix in field_processor for prefixing embedded columns.
- Use StringBuffer instead of List<String> for building the constructor on queryable_processor for more clarity .
- Add embedded_processor_test for testing embeddings.
@codecov
Copy link

codecov bot commented May 28, 2020

Codecov Report

Merging #328 into develop will decrease coverage by 0.25%.
The diff coverage is 82.90%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #328      +/-   ##
===========================================
- Coverage    81.51%   81.25%   -0.26%     
===========================================
  Files           59       63       +4     
  Lines         1509     1590      +81     
===========================================
+ Hits          1230     1292      +62     
- Misses         279      298      +19     
Flag Coverage Δ
#floor 81.25% <82.90%> (-0.26%) ⬇️
#floor_generator 80.82% <82.90%> (-0.27%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
floor_generator/lib/value_object/entity.dart 77.33% <51.51%> (-18.67%) ⬇️
floor_generator/lib/value_object/embedded.dart 69.23% <69.23%> (ø)
...nerator/lib/extension/field_element_extension.dart 100.00% <100.00%> (ø)
...or_generator/lib/processor/embedded_processor.dart 100.00% <100.00%> (ø)
...loor_generator/lib/processor/entity_processor.dart 75.23% <100.00%> (+0.23%) ⬆️
floor_generator/lib/processor/field_processor.dart 89.65% <100.00%> (ø)
...r_generator/lib/processor/queryable_processor.dart 98.07% <100.00%> (+0.51%) ⬆️
floor_generator/lib/processor/view_processor.dart 95.83% <100.00%> (+0.18%) ⬆️
floor_generator/lib/value_object/field.dart 66.66% <100.00%> (+1.44%) ⬆️
floor_generator/lib/value_object/fieldable.dart 100.00% <100.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3efee4d...f9ac68c. Read the comment docs.

- Add boolean extension for parsing nullable fields.
- Add Fieldable abstract class for both (Field, Embedded).
- Passing null in constructor when field is ignore.
- Fix nullable boolean field test case.
- Some improvement and code enhancement.
@proninyaroslav
Copy link

@hsul4n Will this feature reach the final point?

@hsul4n
Copy link
Author

hsul4n commented Jul 8, 2020

@hsul4n Will this feature reach the final point?

Absolutely, but for now theres a major change on api due to #318 & #361, also embedded objects depend on relations annotations to reach final points.

@proninyaroslav
Copy link

@hsul4n
Thank you. Yeah, I really look forward to the support of type converters, as well as the embedded objects. Without them, I will to make very ugly code.

@proninyaroslav
Copy link

@hsul4n
During this time, a lot of work has been done, including the appearance of type converters. It would be great to have also embedded objects 👍

@amkuchta
Copy link

@hsul4n @vitusortner I'm really looking forward to this feature - Floor is exactly what I was looking for in an ORM package, and this is the missing piece that I need. Thank you guys for all of the hard work!

Is there a rough idea of when it will be completed?

@jonasN5
Copy link
Contributor

jonasN5 commented Dec 7, 2020

Any news on embedded & relation features?
ATM I need 3 subsequent queries with post processing to achieve what could be done in a single query :(

@amkuchta
Copy link

@hsul4n @vitusortner any updates on this? It's been about 6 months since I last asked, and it seems to have died... Looks like no changes since 30 July 2020?

@marcosmko
Copy link

any updates?
maybe I could finish this, if needed!

@amkuchta
Copy link

@marcosmko I'd be willing to pitch in, too. I'll need to poke through the code to get an idea if how it all works

@vitusortner
Copy link
Collaborator

@marcosmko, @amkuchta anything I can help you with? This PR has a bunch of conflicts by now but it might still help to get an idea of how to implement the feature. Thanks for your support 🙏

@marcosmko
Copy link

Hello @vitusortner, @amkuchta and @hsul4n, I synced this branch and created #538, but I still need to fix some things that got broken.

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

Successfully merging this pull request may close these issues.

Support embedded objects
6 participants