...
See for example the following :
MetaStoreFactory<X> factoryX = new MetaStoreFactory<X>( X.class, metaStore, "pentaho" );
MetaStoreFactory<Y> factoryY = new MetaStoreFactory<Y>( Y.class, metaStore, "pentaho" );
factoryX.addNameFactory( X.FACTORY_Y, factoryY );
Code Block |
---|
MetaStoreFactory<X> factoryX = new MetaStoreFactory<X>( X.class, metaStore, "pentaho" ); MetaStoreFactory<Y> factoryY = new MetaStoreFactory<Y>( Y.class, metaStore, "pentaho" ); factoryX.addNameFactory( X.FACTORY_Y, factoryY ); |
In this situation, if you call factoryX.saveElement() you will also persist any referenced elements of Y which are annotated as followed in class X:
Code Block |
---|
@MetaStoreAttribute( factoryNameKey = FACTORY_Y, factoryNameReference = true ) private List<Y> ys; //and/or @MetaStoreAttribute( factoryNameKey = FACTORY_Y, factoryNameReference = true ) private Y y; |
The factory is then also used when you are loading elements.
...
Code Block |
---|
@MetaStoreAttribute private boolean shared; |
...
In this case you can reference this in class A as follows:
...