The main steps making by Node application developer:
- You should mark out all persistent classes and write XML-metadata for it.
Impart some additional data about persistent objects to JDO implementation after determination of PSs structure, that’s needed for its saving. Accordingly, file with this meta information is the “metadata file”. Now, you may point, for example, to what attributes in object are persistent and what are not to be keeping but intended for other reasons (transient fields).
- Transmit this metadata file and all class files (in classpath) to enhancer:
Enhancer use example:
JAVA_HOME%\bin\java com.novosoft.jdo.enhancer.Main -xml . metadata_file -dest output_directory_for_enhanced_classes -outxml out_metadata_file
out_metadata_file – it’s your initial hand-written metadata_file wich was supplemented by enhancer.
- The field SimpleObject.intField is not stated in metadata file, so it will be Transient and not be shown to Database.
Now, transmit schema.xml file to enhancer and write to CLASSPATH location your SimpleObject
%JAVA_HOME%\bin\java com.novosoft.jdo.enhancer.Main -xml schema.xml -dest output_directory_for_enhanced_classes -outxml .\out_schema.xml
You take supplemented classes in stated folder (SimpleObject.class)
- And the last step is to build Database using enhancer supplemented scheme
%JAVA_HOME%\bin\java com.novosoft.node.gigabase.GigabaseBuilder out_schema.xml databaseFileName
Now everything is prepared to start the application.
Use implementation PersistenceManagerFactory - com.novosoft.node.jdo.gigabase.NodeGigabasePMFactory to take sample of PersistenceManager. You may take the sample of PMFactory, for it’s turn, using factory method createPersistenceManagerFactory(Properties p). In field Properties point out only the place of searching metadata file.