Skip to content

Commit

Permalink
HHH-18693 Changed Hibernate Core tests to make metamodel classes gene…
Browse files Browse the repository at this point in the history
…ration possible

          - static inner class MUST NOT be private
          - changed full upper case property names
  • Loading branch information
cigaly committed Oct 23, 2024
1 parent 8a750a9 commit c20fa62
Show file tree
Hide file tree
Showing 33 changed files with 61 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected Class<?>[] getAnnotatedClasses() {
}

@Entity(name = "Event")
private static class Event {
static class Event {

@Id
@GeneratedValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected Class<?>[] getAnnotatedClasses() {
}

@Entity(name = "Event")
private static class Event {
static class Event {

@Id
@GeneratedValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected List<String> getManagedClassNames() {
}

@Entity(name = "booking")
private static class Booking {
static class Booking {
@Id Long id;
@Transient String legacyIdentifier;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void test() {
// --- //

@Entity
private static class Author {
static class Author {

@Id
@GeneratedValue
Expand All @@ -60,7 +60,7 @@ private static class Author {
@MappedSuperclass
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.STRING)
private static abstract class Item {
static abstract class Item {

@Id
@GeneratedValue
Expand All @@ -72,6 +72,6 @@ private static abstract class Item {

@Entity
@DiscriminatorValue("child")
private static class ChildItem extends Item {
static class ChildItem extends Item {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void testBidirectionalExisting() {
// -- //

@Entity
private static class Group {
static class Group {

@Id
Long id;
Expand All @@ -63,7 +63,7 @@ void resetUsers() {
}

@Entity
private static class User {
static class User {

@Id
Long id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void test() {
// -- //

@Entity
private static class Group {
static class Group {

@Id
Long id;
Expand All @@ -90,7 +90,7 @@ void resetUsers() {
}

@Entity
private static class User {
static class User {

@Id
Long id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void test() {
// --- //

@Entity
private static class Customer {
static class Customer {

@Id
Long id;
Expand Down Expand Up @@ -97,7 +97,7 @@ void removeInventory(CustomerInventory inventory) {
}

@Entity
private static class CustomerInventory {
static class CustomerInventory {

@Id
Long id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void testSetNull() {
// --- //

@Entity
private static class Customer {
static class Customer {

@Id
Long id;
Expand All @@ -89,7 +89,7 @@ void setUser(User newUser) {
}

@Entity
private static class User {
static class User {

@Id
Long id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void basicExtendedEnhancementTest() {
// --- //

@Entity
private static class SimpleEntity {
static class SimpleEntity {

Object anUnspecifiedObject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void test() {
// --- //

@Entity
private static class Customer {
static class Customer {

@Id
Long id;
Expand All @@ -67,7 +67,7 @@ private static class Customer {
}

@Entity
private static class User {
static class User {

@Id
Long id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void extendedEnhancementTest() {
// --- //

@Entity
private static abstract class Person {
static abstract class Person {

Object anUnspecifiedObject;

Expand All @@ -116,7 +116,7 @@ void setOca(long l) {
}

@Entity
private static class Employee extends Person {
static class Employee extends Person {

String title;

Expand All @@ -134,7 +134,7 @@ void setTitle(String title) {
}

@Entity
private static class Contractor extends Person {
static class Contractor extends Person {

Integer rate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void extendedEnhancementTest() {
// --- //

@MappedSuperclass
private static class Person {
static class Person {

Object anUnspecifiedObject;

Expand All @@ -102,7 +102,7 @@ void setOca(long l) {
}

@Entity
private static class Employee extends Person {
static class Employee extends Person {

String title;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void test() {
// --- //

@Embeddable
private static class Address1 {
static class Address1 {
String street1;
String street2;
String city;
Expand All @@ -47,7 +47,7 @@ private static class Address1 {
String phone;
}

private static class Address2 {
static class Address2 {
String street1;
String street2;
String city;
Expand All @@ -57,7 +57,7 @@ private static class Address2 {
}

@Entity
private static class SimpleEntity {
static class SimpleEntity {

@Id
Long id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void test() {
// --- //

@Embeddable
private static class Address {
static class Address {
@Embedded
Country country;
String street1;
Expand All @@ -112,12 +112,12 @@ private static class Address {
}

@Embeddable
private static class Country {
static class Country {
String name;
}

@Entity
private static class SimpleEntity {
static class SimpleEntity {

@Id
Long id;
Expand Down Expand Up @@ -149,7 +149,7 @@ public void setSomeNumber(Long someNumber) {
}

@Entity
private static class OtherEntity {
static class OtherEntity {
@Id
Long id;
String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void cleanup() {
@Table( name = "PERSON" )
@DynamicUpdate
@DynamicInsert
private static class Person {
static class Person {

@Id
Long id;
Expand All @@ -155,7 +155,7 @@ private static class Person {
@Table( name = "PERSON_ADDRESS" )
@DynamicUpdate
@DynamicInsert
private static class PersonAddress {
static class PersonAddress {

@Id
Long id;
Expand All @@ -168,7 +168,7 @@ private static class PersonAddress {
@Table(name = "NULLABLE_PERSON")
@DynamicUpdate
@DynamicInsert
private static class NullablePerson {
static class NullablePerson {

@Id
Long id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private void loadBook(long bookId, Session session) {
@Entity(name = "Book")
@Cacheable
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
private static final class Book {
static final class Book {

@Id
private Long id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void testCalcViewDTO() throws Exception {

@Entity(name = "CVEntity")
@Table(name = CALC_VIEW_NAME)
private static class CVEntity {
static class CVEntity {

private String dummydummy;
private double dummydouble;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ private void checkCacheConsistency(MergeContext cache, int expectedSize) {
}

@Entity
private static class Simple {
static class Simple {
@Id
private int value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void testAllPropertiesCopied() {
}

@Entity(name = "`Order`")
private static class Order {
static class Order {
@Id
public Long id;

Expand Down Expand Up @@ -99,7 +99,7 @@ public int hashCode() {
}

@Entity(name = "Item")
private static class Item {
static class Item {
@Id
public Long id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void testAllPropertiesCopied() {
}

@Entity
private static class Order {
static class Order {
@Id
public Long id;

Expand Down Expand Up @@ -106,7 +106,7 @@ public int hashCode() {
}

@Entity
private static class Item {
static class Item {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ protected Class[] getAnnotatedClasses() {
}

@Entity(name = "AnEntity")
private static class AnEntity {
static class AnEntity {
@Id
private long id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public boolean isPersonLastUpdatedAtChanged() {

@Entity(name = "Person")
@DynamicUpdate
private static class Person {
static class Person {
@Id
@GeneratedValue
private int id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private SessionBuilder sessionWithInterceptor() {

@Entity(name = "Person")
@DynamicUpdate
private static class Person {
static class Person {
@Id
@GeneratedValue
private int id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected Class[] getAnnotatedClasses() {

@Entity( name = "Item" )
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
private static abstract class Item {
static abstract class Item {

@Id @GeneratedValue
@Column(name = "`ID`")
Expand All @@ -150,14 +150,14 @@ private static abstract class Item {

@Entity
@Table(name = "`CoNTaiNeR`")
private static class Container extends Item {
static class Container extends Item {

@OneToMany(mappedBy = "parent", targetEntity = Item.class)
private Set<Item> items = new HashSet<Item>( 0 );
}

@Entity
@Table(name = "`SimpleItem`")
private static class SimpleItem extends Item {
static class SimpleItem extends Item {
}
}
Loading

0 comments on commit c20fa62

Please sign in to comment.