1. Create the model classes
2. Create a test
3. Create the PersistenceObjects
4. Describe the classes
> 5. Configure DatabaseManager and create the database
6. Use the PersistenceObjects in your controllers
7. Add database-methods
5. Configure DatabaseManager and create the database.
PersistenceObjects use a DatabaseManager-class for all database-queries. The manager needs to be configured. There is a conf.ini-file located in lib/databasemanager/conf-folder. Setup the configuration as is best for your case.
[mysql_settings] host = localhost user = root password = port = database = persistenceobjectstest
There is also a logger that is used for logging everything possible as loggers usually do. Be aware that only NONE and ERRORS loglevel should be used on deployed enviroments since logging affects performance a lot. Logger has a simple conf.ini file in it's conf folder. The default is usually enough.
// acceptable logLevels: NONE, ERRORS, EVENTS, QUERIES, ALL [logger_settings] logFile = log.txt logLevel = NONE
Finally we have to create the tables in the database. The database setup for this example is like this:
If everything is done correctly the test should run and no exceptions should come up.
previous - Describe the classesnext - Use the PersistenceObjects in your controllers