HHH-16261 - Test case for HHH-16261
This commit is contained in:
parent
9be331cb97
commit
de8b40ea79
|
@ -0,0 +1,7 @@
|
|||
package org.hibernate.jpamodelgen.test.records;
|
||||
|
||||
import jakarta.persistence.Embeddable;
|
||||
|
||||
@Embeddable
|
||||
public record Address(String street, String city, String postalCode) {
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package org.hibernate.jpamodelgen.test.records;
|
||||
|
||||
import jakarta.persistence.Embedded;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class Author {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
@Embedded
|
||||
private Address address;
|
||||
|
||||
private String firstName;
|
||||
|
||||
private String lastName;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Address getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(Address address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.hibernate.jpamodelgen.test.records;
|
||||
|
||||
import org.hibernate.jpamodelgen.test.util.CompilationTest;
|
||||
import org.hibernate.jpamodelgen.test.util.TestForIssue;
|
||||
import org.hibernate.jpamodelgen.test.util.WithClasses;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hibernate.jpamodelgen.test.util.TestUtil.assertMetamodelClassGeneratedFor;
|
||||
|
||||
public class Java14RecordsTest extends CompilationTest {
|
||||
|
||||
@Test
|
||||
@TestForIssue(jiraKey = "HHH-16261")
|
||||
@WithClasses({Address.class, Author.class})
|
||||
public void testEmbeddableRecordProperty() {
|
||||
assertMetamodelClassGeneratedFor(Address.class);
|
||||
assertMetamodelClassGeneratedFor(Author.class);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue