new database, sql fixes, SAX bug fixes and entity sql generation fixes