📄 tuplizertest.java
字号:
//$Id: $
package org.hibernate.test.annotations.tuplizer;
import org.hibernate.test.annotations.TestCase;
import org.hibernate.Session;
/**
* @author Emmanuel Bernard
*/
public class TuplizerTest extends TestCase {
public void testEntityTuplizer() throws Exception {
Cuisine cuisine = ProxyHelper.newCuisineProxy( null );
cuisine.setName( "Fran鏰ise" );
Country country = ProxyHelper.newCountryProxy( null );
country.setName( "France" );
cuisine.setCountry( country );
Session s = openSession( new EntityNameInterceptor() );
s.getTransaction().begin();
s.persist( cuisine );
s.flush();
s.clear();
cuisine = (Cuisine) s.get(Cuisine.class, cuisine.getId() );
assertNotNull( cuisine );
assertEquals( "Fran鏰ise", cuisine.getName() );
assertEquals( "France", country.getName() );
s.getTransaction().rollback();
s.close();
}
protected Class[] getMappings() {
return new Class[] {
Cuisine.class
};
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -