Methods Summary |
---|
public void | afterSessionFactoryBuilt(org.hibernate.engine.SessionFactoryImplementor sfi)
super.afterSessionFactoryBuilt( sfi );
Session session = null;
try {
session = sfi.openSession();
Statement st = session.connection().createStatement();
try {
st.execute( "drop table Point");
}
catch( Throwable ignore ) {
// ignore
}
st.execute("create table Point (\"x\" number(19,2) not null, \"y\" number(19,2) not null, description varchar2(255) )");
}
catch ( SQLException e ) {
throw new RuntimeException( "Unable to build actual schema : " + e.getMessage() );
}
finally {
if ( session != null ) {
try {
session.close();
}
catch( Throwable ignore ) {
// ignore
}
}
}
|
public boolean | appliesTo(org.hibernate.dialect.Dialect dialect)
return dialect instanceof Oracle9Dialect;
|
public boolean | createSchema()
return false;
|
public java.lang.String | getCacheConcurrencyStrategy()
return null;
|
public java.lang.String[] | getMappings()
return new String[] { "rowid/Point.hbm.xml" };
|
public static junit.framework.Test | suite()
return new FunctionalTestClassTestSuite( RowIdTest.class );
|
public void | testRowId()
Session s = openSession();
Transaction t = s.beginTransaction();
Point p = new Point( new BigDecimal(1.0), new BigDecimal(1.0) );
s.persist(p);
t.commit();
s.clear();
t = s.beginTransaction();
p = (Point) s.createCriteria(Point.class).uniqueResult();
p.setDescription("new desc");
t.commit();
s.clear();
t = s.beginTransaction();
p = (Point) s.createQuery("from Point").uniqueResult();
p.setDescription("new new desc");
t.commit();
s.clear();
t = s.beginTransaction();
p = (Point) s.get(Point.class, p);
p.setDescription("new new new desc");
t.commit();
s.close();
|