Skip to content

Conversation

@chanhengseang3
Copy link
Contributor

@chanhengseang3 chanhengseang3 commented Apr 8, 2019

fix Issues #102

When ever the Entity has methods that is public and have method name starting with set , building schema will fail. This version make a small change ( bypass check for read properties ) so that build can pass.

@Data
@Entity
public class Book {
	@Id
	Long id;

	@GraphQLIgnoreOrder
	@GraphQLIgnoreFilter
	String title;

	@ManyToOne(fetch=FetchType.LAZY)
	Author author;

	@Enumerated(EnumType.STRING)
	Genre genre;

	/**
	 * Method that have name start with "set" and have at least one arguments will Lead to Error on build time
	 * *Method* that doesn't have a argument won't give error
         * *Method* that does not public won't give error
	 * @param i
	 */
	public void setSth(int i){
		return;
	}

}

Copy link
Collaborator

@igdianov igdianov left a comment

Choose a reason for hiding this comment

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

Thank you for your PR. Could you add a test case for the fix? You can use existing transient test for this

@codecov
Copy link

codecov bot commented Apr 8, 2019

Codecov Report

Merging #106 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #106      +/-   ##
============================================
+ Coverage     65.73%   65.75%   +0.01%     
  Complexity      366      366              
============================================
  Files            37       37              
  Lines          2014     2015       +1     
  Branches        296      297       +1     
============================================
+ Hits           1324     1325       +1     
  Misses          562      562              
  Partials        128      128
Impacted Files Coverage Δ Complexity Δ
...phql/jpa/query/schema/impl/IntrospectionUtils.java 84.84% <100%> (+0.47%) 5 <0> (ø) ⬇️

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 2d2f5d1...e9e0677. Read the comment docs.

@chanhengseang3
Copy link
Contributor Author

I added a method in Entity Book.java. I think there is no need to write another test case , because failure happen during build schema, all the other test will fail automatically when try to build schema if the bug is not fixed.

@igdianov
Copy link
Collaborator

@chanhengseang3 LGTM! I am merging this into master branch. Thank you very much for your contribution!

@igdianov igdianov merged commit fb45d23 into introproventures:master Apr 12, 2019
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.

3 participants