METAGEN-20 better example names
This commit is contained in:
parent
b78ebb332c
commit
76d2d32a4a
|
@ -1,68 +0,0 @@
|
|||
package org.hibernate.jpamodelgen.test.rawTypes;
|
||||
|
||||
import java.util.Collection;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@Entity
|
||||
public class A implements java.io.Serializable {
|
||||
|
||||
@Id
|
||||
protected String id;
|
||||
|
||||
@Basic
|
||||
protected String name;
|
||||
|
||||
@Basic
|
||||
protected int value;
|
||||
|
||||
|
||||
public A() {
|
||||
}
|
||||
|
||||
@ManyToMany(targetEntity = B.class, cascade = CascadeType.ALL)
|
||||
@JoinTable(name = "tbl_A_B",
|
||||
joinColumns =
|
||||
@JoinColumn(
|
||||
name = "A_FK", referencedColumnName = "ID"),
|
||||
inverseJoinColumns =
|
||||
@JoinColumn(
|
||||
name = "B_FK", referencedColumnName = "ID")
|
||||
)
|
||||
protected Collection bCol = new java.util.ArrayList();
|
||||
|
||||
|
||||
public Collection getBCol() {
|
||||
return bCol;
|
||||
}
|
||||
|
||||
public void setBCol(Collection bCol) {
|
||||
this.bCol = bCol;
|
||||
}
|
||||
|
||||
public String getAId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getAName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setAName(String aName) {
|
||||
this.name = aName;
|
||||
}
|
||||
|
||||
|
||||
public int getAValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package org.hibernate.jpamodelgen.test.rawTypes;
|
||||
|
||||
import java.util.Collection;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@Entity
|
||||
public class B implements java.io.Serializable {
|
||||
|
||||
@Id
|
||||
protected String id;
|
||||
|
||||
@Basic
|
||||
protected String name;
|
||||
|
||||
@Basic
|
||||
protected int value;
|
||||
|
||||
|
||||
@ManyToMany(targetEntity = A.class, mappedBy = "bCol", cascade = CascadeType.ALL)
|
||||
protected Collection aCol = new java.util.ArrayList();
|
||||
|
||||
|
||||
public B() {
|
||||
}
|
||||
|
||||
|
||||
public Collection getACol() {
|
||||
return aCol;
|
||||
}
|
||||
|
||||
public void setACol(Collection aCol) {
|
||||
this.aCol = aCol;
|
||||
}
|
||||
|
||||
public String getBId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getBName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getBValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package org.hibernate.jpamodelgen.test.rawTypes;
|
||||
|
||||
import java.util.Collection;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.ManyToMany;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@Entity
|
||||
public class DeskWithRawType implements java.io.Serializable {
|
||||
|
||||
@Id
|
||||
protected String id;
|
||||
|
||||
@Basic
|
||||
protected String name;
|
||||
|
||||
|
||||
public DeskWithRawType() {
|
||||
}
|
||||
|
||||
@ManyToMany(targetEntity = EmployeeWithRawType.class, cascade = CascadeType.ALL)
|
||||
@JoinTable(name = "DESK_EMPL",
|
||||
joinColumns =
|
||||
@JoinColumn(
|
||||
name = "DESK_FK", referencedColumnName = "ID"),
|
||||
inverseJoinColumns =
|
||||
@JoinColumn(
|
||||
name = "EMPLO_FK", referencedColumnName = "ID")
|
||||
)
|
||||
protected Collection employees = new java.util.ArrayList();
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Collection getEmployees() {
|
||||
return employees;
|
||||
}
|
||||
|
||||
public void setEmployees(Collection employees) {
|
||||
this.employees = employees;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package org.hibernate.jpamodelgen.test.rawTypes;
|
||||
|
||||
import java.util.Collection;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToMany;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@Entity
|
||||
public class EmployeeWithRawType implements java.io.Serializable {
|
||||
|
||||
@Id
|
||||
protected String id;
|
||||
|
||||
@Basic
|
||||
protected String name;
|
||||
|
||||
|
||||
@ManyToMany(targetEntity = DeskWithRawType.class, mappedBy = "employees", cascade = CascadeType.ALL)
|
||||
protected Collection desks = new java.util.ArrayList();
|
||||
|
||||
|
||||
public EmployeeWithRawType() {
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Collection getDesks() {
|
||||
return desks;
|
||||
}
|
||||
|
||||
public void setDesks(Collection desks) {
|
||||
this.desks = desks;
|
||||
}
|
||||
}
|
|
@ -30,12 +30,12 @@ public class RawTypesTest extends CompilationTest {
|
|||
|
||||
@Test
|
||||
public void testGenerics() {
|
||||
assertClassGenerated( A.class.getName() + "_" );
|
||||
assertClassGenerated( B.class.getName() + "_" );
|
||||
assertClassGenerated( DeskWithRawType.class.getName() + "_" );
|
||||
assertClassGenerated( EmployeeWithRawType.class.getName() + "_" );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestPackage() {
|
||||
return A.class.getPackage().getName();
|
||||
return DeskWithRawType.class.getPackage().getName();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue