DemoData data = new DemoData();
data.init();
GenericDao dao = new DemoDataGenericDao( data );
YogaBuilder builder = new YogaBuilder()
.withClassFinderStrategy( new HibernateClassFinderStrategy() )
.withAliasProperties( this.getClass().getClassLoader().getResourceAsStream( "selectorAlias.properties" ) )
.withOutputCountLimit( 2000 )
.enableYogaLinks()
.registerYogaMetaDataClasses( User.class, Album.class, Artist.class, Song.class )
.registerEntityConfigurations( new UserConfiguration( dao ) );
getSingletons().add( new AlbumResource( dao ) );
getSingletons().add( new ArtistResource( dao ) );
getSingletons().add( new SongResource( dao ) );
getSingletons().add( new UserResource( dao ) );
getSingletons().add( new MetaDataController( builder.getMetaDataRegistry() ) );
YogaBuilderViewFactory util = new YogaBuilderViewFactory( builder );
getSingletons().add( new StreamingJsonSelectorMessageBodyWriter( util ) );
getSingletons().add( new XmlSelectorMessageBodyWriter( util ) );
getSingletons().add( new SelectorBuilderMessageBodyWriter( util ) );