Class transportationPk = ucl.loadClass( "org.hibernate.tool.hbm2x.TransportationPk" );
configuration.addAnnotatedClass( train );
configuration.addAnnotatedClass( passenger );
configuration.setProperty( "hibernate.hbm2ddl.auto", "create-drop" );
SessionFactory sf = configuration.buildSessionFactory();
Session s = sf.openSession();
Object trainId = transportationPk.newInstance();
transportationPk.getMethod( "setCity", new Class[]{String.class} ).invoke( trainId, new Object[]{"Paris"} );
transportationPk.getMethod( "setLine", new Class[]{String.class} ).invoke( trainId, new Object[]{"Ligne 1"} );