Code example for Collection

Methods: getCollectionPersisterClassgetRole

0
 
	@Test
	public void testCollectionPersisterSpecified() throws Exception {
		//tests the persister specified by the @Persister annotation on a collection 
		Collection collection = (Collection) configuration().getCollectionMapping( Deck.class.getName() + ".cards" );
		assertEquals( "Incorrect Persister class for collection " + collection.getRole(), CollectionPersister.class,
				collection.getCollectionPersisterClass() );
	} 
 
	@Override 
	protected Class[] getAnnotatedClasses() {
		return new Class[]{
				Card.class, 
				Deck.class 
		}; 
	} 
}