-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix for 5274 #5276
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
Fix for 5274 #5276
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.quarkus.it.panache; | ||
|
||
import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase; | ||
|
||
public class AbstractRepository<T> implements PanacheRepositoryBase<T, String> { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.quarkus.it.panache; | ||
|
||
import javax.enterprise.context.ApplicationScoped; | ||
|
||
@ApplicationScoped | ||
public class Bug5274EntityRepository extends AbstractRepository<Person> { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -789,4 +789,15 @@ public Person ignoredProperties() throws NoSuchMethodException, SecurityExceptio | |
person.status = Status.DECEASED; | ||
return person; | ||
} | ||
|
||
@Inject | ||
Bug5274EntityRepository bug5274EntityRepository; | ||
|
||
@GET | ||
@Path("5274") | ||
@Transactional | ||
public String testBug5274() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe named it testWithAbstractParentEntity and add a link to the bug will be more explainatory ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer having the issue number in the test name because that really has more info than whatever name I could come up with. We could add a link as comment, but I've never felt the need for it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, as you prefere :) |
||
bug5274EntityRepository.count(); | ||
return "OK"; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.quarkus.it.mongodb.panache.bugs; | ||
|
||
import io.quarkus.mongodb.panache.PanacheMongoRepositoryBase; | ||
|
||
public class AbstractRepository<T> implements PanacheMongoRepositoryBase<T, String> { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.quarkus.it.mongodb.panache.bugs; | ||
|
||
import javax.enterprise.context.ApplicationScoped; | ||
|
||
import io.quarkus.it.mongodb.panache.book.Book; | ||
|
||
@ApplicationScoped | ||
public class Bug5274EntityRepository extends AbstractRepository<Book> { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.quarkus.it.mongodb.panache.bugs; | ||
|
||
import javax.inject.Inject; | ||
import javax.ws.rs.Consumes; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
@Path("/bugs") | ||
@Produces(MediaType.TEXT_PLAIN) | ||
@Consumes(MediaType.TEXT_PLAIN) | ||
public class BugResource { | ||
|
||
@Inject | ||
Bug5274EntityRepository bug5274EntityRepository; | ||
|
||
@GET | ||
@Path("5274") | ||
public String testBug5274() { | ||
bug5274EntityRepository.count(); | ||
return "OK"; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you just avoid any enahcement for abstract repositories/entities ?
This way it will speed up the build process no ?
And you will also be able to remove some cheks inside the processor as PanacheEntity itself is abstract
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this also happens for non-abstract classes, as my test shows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK