Skip to content

fix: add query support for entities with @EmbeddedId attribute #180

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

Merged
merged 1 commit into from
Aug 31, 2019

Conversation

igdianov
Copy link
Collaborator

@igdianov igdianov commented Aug 31, 2019

This PR adds query support for entitites with @EmbeddedId attributes, i.e. given:

@Data
@Entity
public class Book {

    @EmbeddedId
    private BookId bookId;

    private String description;
} 

with embedded id attribute

@Data
@Embeddable
public class BookId implements Serializable {
    private static final long serialVersionUID = 1L;

    private String title;
    private String language;
} 

then, use query with embedded id:

query {
  Books( 
    where: {
      bookId: {
        EQ: {
          title:  "War and Piece"
          language:  "Russian"
        }
      }
    }
  ){
    total
    pages
    select {
      bookId {
        title
        language
      }
      description
    }
  }
}

@igdianov igdianov self-assigned this Aug 31, 2019
@igdianov igdianov added the bug label Aug 31, 2019
@codecov
Copy link

codecov bot commented Aug 31, 2019

Codecov Report

Merging #180 into master will increase coverage by 0.28%.
The diff coverage is 88.46%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #180      +/-   ##
============================================
+ Coverage     68.54%   68.83%   +0.28%     
- Complexity      511      516       +5     
============================================
  Files            33       33              
  Lines          2639     2663      +24     
  Branches        432      436       +4     
============================================
+ Hits           1809     1833      +24     
+ Misses          665      664       -1     
- Partials        165      166       +1
Impacted Files Coverage Δ Complexity Δ
...hql/jpa/query/schema/impl/JpaPredicateBuilder.java 56.47% <100%> (+0.6%) 108 <0> (ø) ⬇️
...a/query/schema/impl/QraphQLJpaBaseDataFetcher.java 75.85% <88%> (+0.53%) 166 <4> (+5) ⬆️

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 50df533...e5a5444. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Aug 31, 2019

Codecov Report

Merging #180 into master will increase coverage by 0.28%.
The diff coverage is 88.46%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #180      +/-   ##
============================================
+ Coverage     68.54%   68.83%   +0.28%     
- Complexity      511      516       +5     
============================================
  Files            33       33              
  Lines          2639     2663      +24     
  Branches        432      436       +4     
============================================
+ Hits           1809     1833      +24     
+ Misses          665      664       -1     
- Partials        165      166       +1
Impacted Files Coverage Δ Complexity Δ
...hql/jpa/query/schema/impl/JpaPredicateBuilder.java 56.47% <100%> (+0.6%) 108 <0> (ø) ⬇️
...a/query/schema/impl/QraphQLJpaBaseDataFetcher.java 75.85% <88%> (+0.53%) 166 <4> (+5) ⬆️

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 50df533...e5a5444. Read the comment docs.

@igdianov igdianov merged commit 6552cb8 into master Aug 31, 2019
@igdianov igdianov deleted the igdianov-fix-embeddable-id branch August 31, 2019 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant