HHH-11217 - Add test for issue
This commit is contained in:
parent
aa5f893267
commit
f9a408815e
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE hibernate-mapping PUBLIC
|
||||
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
||||
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
|
||||
|
||||
<hibernate-mapping>
|
||||
<class name="org.hibernate.test.refresh.Customer"
|
||||
entity-name="CustomName"
|
||||
lazy="false">
|
||||
|
||||
<id name="id"/>
|
||||
</class>
|
||||
</hibernate-mapping>
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.refresh;
|
||||
|
||||
/**
|
||||
* @author Andrea Boriero
|
||||
*/
|
||||
public class Customer {
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.refresh;
|
||||
|
||||
import org.hibernate.Session;
|
||||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
|
||||
|
||||
/**
|
||||
* @author Andrea Boriero
|
||||
*/
|
||||
@TestForIssue(jiraKey = "HHH-11217")
|
||||
public class RefreshUsingEntityNameTest extends BaseCoreFunctionalTestCase {
|
||||
private Customer customer;
|
||||
|
||||
@Override
|
||||
public String[] getMappings() {
|
||||
return new String[] {"refresh/Customer.hbm.xml"};
|
||||
}
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
customer = new Customer();
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
session.save( "CustomName", customer );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testRefreshUsingEntityName() {
|
||||
try (final Session session = openSession();) {
|
||||
session.refresh( "CustomName", customer );
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue