...
For your convenience we provided you with a MetaStoreFactory to facilitate the specific use-case of serializing POJO.
Consider a class annotated with @MetaStoreElementType and where private members are annotated with @MetaStoreAttribute
Code Block |
---|
MyElement me = new MyElement( NAME, ATTR, ANOTHER, INT, LONG, BOOL, DATE ); |
...
MetaStoreFactory<MyElement> factory = new MetaStoreFactory<MyElement>( MyElement.class, metaStore, "custom" ); |
now Now we can save the element in the metastore simply by calling:
Code Block |
---|
factory.saveElement( me ); |
Loading the element by name from the metastore simply becomes:
Code Block |
---|
MyElement verify = factory.loadElement( NAME ); |
...
|
The unit test class which demos this behavior is: MetaStoreFactoryTest For your convenience we provided you with a MetaStoreFactory to facilitate the specific use-case of serializing POJO.
Consider a class annotated with @MetaStoreElementType and where private members are annotated with @MetaStoreAttribute
MyElement me = new MyElement( NAME, ATTR, ANOTHER, INT, LONG, BOOL, DATE );
MetaStoreFactory<MyElement> factory = new MetaStoreFactory<MyElement>( MyElement.class, metaStore, "custom" );
now we can save the element in the metastore simply by calling:
factory.saveElement( me );
Loading the element by name from the metastore simply becomes:
MyElement verify = factory.loadElement( NAME );
The unit test class which demos this behavior is: MetaStoreFactoryTest The list of available methods in the factory is:
- public T loadElement( String name ) throws MetaStoreException;
- public void saveElement( T t ) throws MetaStoreException;
- public List<T> getElements() throws MetaStoreException;
- public void deleteElement( String name ) throws MetaStoreException;
- public List<String> getElementNames() throws MetaStoreException;
- public IMetaStoreElementType getElementType() throws MetaStoreException;
- public T loadElement( String name ) throws MetaStoreException;
public void saveElement( T t ) throws MetaStoreException;
public List<T> getElements() throws MetaStoreException;
public void deleteElement( String name ) throws MetaStoreException;
public List<String> getElementNames() throws MetaStoreException;
public IMetaStoreElementType getElementType() throws MetaStoreException;