mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-13 21:01:01 +08:00
Add test
This commit is contained in:
parent
175b2668ba
commit
245be9328c
@ -0,0 +1,49 @@
|
||||
package com.querydsl.apt.domain;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
public class InitTest {
|
||||
|
||||
@Entity
|
||||
public static class User {
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
private Address address;
|
||||
|
||||
}
|
||||
|
||||
@Entity
|
||||
public static class Address extends AddressBase {
|
||||
|
||||
}
|
||||
|
||||
@MappedSuperclass
|
||||
public abstract static class AddressBase {
|
||||
|
||||
@Id
|
||||
private long idAddress;
|
||||
|
||||
@Id
|
||||
private int numVersion;
|
||||
|
||||
@ManyToOne
|
||||
private City city;
|
||||
|
||||
}
|
||||
|
||||
@Entity
|
||||
public static class City {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
assertNotNull(QInitTest_User.user.address.city);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user