Add one more test

This commit is contained in:
Andrea Boriero 2020-03-06 09:49:48 +00:00
parent b5080b555f
commit e0ffa498b1
1 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,6 @@
package org.hibernate.orm.test.metamodel.mapping.array; package org.hibernate.orm.test.metamodel.mapping.array;
import java.util.List;
import javax.persistence.ElementCollection; import javax.persistence.ElementCollection;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
@ -47,14 +48,11 @@ public class ArrayTests {
); );
} }
@BeforeEach @BeforeEach
public void setUp(SessionFactoryScope scope) { public void setUp(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {
ArrayTests.Employee employee = new ArrayTests.Employee(); ArrayTests.Employee employee = new ArrayTests.Employee( 1, "Koen" );
employee.setId( 1 );
employee.setName( "Koen" );
employee.setToDoList( new String[] { "metro", "boulot", "dodo" } ); employee.setToDoList( new String[] { "metro", "boulot", "dodo" } );
session.save( employee ); session.save( employee );
} }
@ -76,6 +74,14 @@ public class ArrayTests {
private String name; private String name;
private String[] toDoList; private String[] toDoList;
public Employee() {
}
public Employee(Integer id, String name) {
this.id = id;
this.name = name;
}
@Id @Id
public Integer getId() { public Integer getId() {
return id; return id;