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

@Join and JoinPath #1185

Merged
merged 6 commits into from
Feb 14, 2020
Merged

@Join and JoinPath #1185

merged 6 commits into from
Feb 14, 2020

Conversation

hellohanchen
Copy link
Contributor

@hellohanchen hellohanchen commented Feb 11, 2020

Resolves #1005

Description

  • Add @Join annotation for Table to use to join to other tables or entities.
  • Add JoinPath which is a path but can navigate through models using @Join annotation.
  • Add TableTag and ColumnTag.
  • Add API in EntityDictionary to allow hiding a field from API.

How Has This Been Tested?

unit tests and integration tests.

License

I confirm that this contribution is made under an Apache 2.0 license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@coveralls
Copy link
Collaborator

coveralls commented Feb 11, 2020

Coverage Status

Coverage decreased (-0.06%) to 79.235% when pulling db5479b on hellohanchen:join into d21a42e on yahoo:elide-5.x.

* @param entityBinding EntityBinding instance
*/
public void bindEntity(EntityBinding entityBinding) {
Class<?> declaredClass = entityBinding.entityClass;
Copy link
Member

Choose a reason for hiding this comment

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

Why not have this method call the new bindEntity method with an empty set (or a set that includes Exclude)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This bindEntity method needs to keep all information from the existing binding, as the hiddenAnnotations are not tracked in EntityBinding, if we bind the class again in a different dictionary, previous hiddenAnnotations would not be applied.

@@ -178,6 +178,13 @@
<version>2.5.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.ant</groupId>
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need ant?

Copy link
Contributor Author

@hellohanchen hellohanchen Feb 14, 2020

Choose a reason for hiding this comment

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

Used for reading in graphql expected response from json file.

Copy link
Member

Choose a reason for hiding this comment

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

I'd rather not add a dependency on ant in Elide. There are other places in Elide where we slurp in files. Let's just do the same approach.

@Exclude
@ToString.Exclude
private final Map<String, Column> columnMap;

public Table(Class<?> cls, EntityDictionary dictionary) {
if (!dictionary.getBindings().contains(cls)) {
if (!dictionary.getBoundClasses().contains(cls)) {
Copy link
Member

Choose a reason for hiding this comment

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

If Table is going to be a simple POJO - we probably don't need to pass dictionary to it. This will also simplify the Fili integration.

Copy link
Contributor Author

@hellohanchen hellohanchen Feb 14, 2020

Choose a reason for hiding this comment

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

If using all argument builder, there is not need to provide a dictionary. Fili can use that.

@chczy chczy merged commit c0c645b into yahoo:elide-5.x Feb 14, 2020
@hellohanchen hellohanchen deleted the join branch February 18, 2020 21:24
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.

4 participants