forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#39715 from marko-bekhta/fix/i39299-orm-a…
…nnotations-on-package-info Update Hibernate ORM package/class processing rules
- Loading branch information
Showing
24 changed files
with
94 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...quarkus/hibernate/orm/packages/PackageLevelAnnotationWithExplicitPackagePropertyTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package io.quarkus.hibernate.orm.packages; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.util.List; | ||
|
||
import jakarta.inject.Inject; | ||
import jakarta.persistence.EntityManager; | ||
import jakarta.transaction.UserTransaction; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.hibernate.orm.TransactionTestUtils; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class PackageLevelAnnotationWithExplicitPackagePropertyTest { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest runner = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClass(TransactionTestUtils.class) | ||
.addPackage(PackageLevelAnnotationWithExplicitPackagePropertyTest.class.getPackage())) | ||
.withConfigurationResource("application.properties") | ||
.overrideConfigKey("quarkus.hibernate-orm.packages", "io.quarkus.hibernate.orm.packages"); | ||
|
||
@Inject | ||
EntityManager entityManager; | ||
|
||
@Inject | ||
UserTransaction transaction; | ||
|
||
@Test | ||
public void test() { | ||
ParentEntity parent1 = new ParentEntity("parent1"); | ||
|
||
inTransaction(() -> { | ||
entityManager.persist(parent1); | ||
}); | ||
|
||
inTransaction(() -> { | ||
final List<ParentEntity> list = entityManager.createNamedQuery("test", ParentEntity.class) | ||
.getResultList(); | ||
assertThat(list.size()).isEqualTo(1); | ||
}); | ||
} | ||
|
||
private void inTransaction(Runnable runnable) { | ||
TransactionTestUtils.inTransaction(transaction, runnable); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...ibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/packages/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
@NamedQuery(name = "test", query = "from ParentEntity") | ||
@FilterDef(name = "filter", defaultCondition = "true") | ||
package io.quarkus.hibernate.orm.packages; | ||
|
||
import org.hibernate.annotations.FilterDef; | ||
import org.hibernate.annotations.NamedQuery; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rkus/it/jpa/postgresql/EntityWithXml.java → ...a/postgresql/defaultpu/EntityWithXml.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../io/quarkus/it/jpa/postgresql/Person.java → ...s/it/jpa/postgresql/defaultpu/Person.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/it/jpa/postgresql/SequencedAddress.java → ...ostgresql/defaultpu/SequencedAddress.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../io/quarkus/it/jpa/postgresql/Status.java → ...s/it/jpa/postgresql/defaultpu/Status.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...io/quarkus/it/jpa/postgresql/Address.java → .../it/jpa/postgresql/defaultpu/Address.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../io/quarkus/it/jpa/postgresql/Animal.java → ...s/it/jpa/postgresql/defaultpu/Animal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...o/quarkus/it/jpa/postgresql/Customer.java → ...it/jpa/postgresql/defaultpu/Customer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...kus/it/jpa/postgresql/EntityWithJson.java → .../postgresql/defaultpu/EntityWithJson.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...a/io/quarkus/it/jpa/postgresql/Human.java → ...us/it/jpa/postgresql/defaultpu/Human.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...arkus/it/jpa/postgresql/MyUUIDEntity.java → ...pa/postgresql/defaultpu/MyUUIDEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package io.quarkus.it.jpa.postgresql; | ||
package io.quarkus.it.jpa.postgresql.defaultpu; | ||
|
||
import java.util.UUID; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
.../postgresql/NotAnEntityNotReferenced.java → ...l/defaultpu/NotAnEntityNotReferenced.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../io/quarkus/it/jpa/postgresql/Person.java → ...s/it/jpa/postgresql/defaultpu/Person.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/it/jpa/postgresql/SequencedAddress.java → ...ostgresql/defaultpu/SequencedAddress.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../io/quarkus/it/jpa/postgresql/Status.java → ...s/it/jpa/postgresql/defaultpu/Status.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...uarkus/it/jpa/postgresql/WorkAddress.java → ...jpa/postgresql/defaultpu/WorkAddress.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters