* @param args
*/
public static void main( String[] args ) {
ApplicationContext context = new ClassPathXmlApplicationContext( "cubus_beans.xml" );
UserAccountDao dao = (UserAccountDao) context.getBean( "userAccountDao" );
UserAccount account = (UserAccount) context.getBean( "userAccount" );
account.setCreated( new Date() );
account.setLastLogin( new Date() );
account.setUsername( "schlierf" );
for ( int i = 0; i < 5; i++ ) {
Identity identity = (Identity) context.getBean( "identity" );
identity.setBcc( "bcc" + 1 );
identity.setDisplayName( "Displayname" + 1 );
identity.setEmail( "email" + 1 );
identity.setOrganisation( "organisation" + 1 );
account.addIdentity( identity );
}
Long id = dao.saveUserAccount( account );
System.out.println( "id " + id );
}