NeoDatis Object Database
1.9.1
Copyright © 2006-2009 NeoDatis
Publication date 07 Jun 2009
NeoDatis 1.9.1 NeoDatis Object Database ii
Table of Contents
1. Overview ............................................................................................................................. 1
1.1. Simple ...................................................................................................................... 1
1.2. Small ........................................................................................................................ 1
1.3. Fast ........................................................................................................................... 1
1.4. Safe and robust ........................................................................................................ 1
1.5. One single database file ........................................................................................... 1
1.6. Multiplatform ........................................................................................................... 2
1.7. Data are always available ........................................................................................ 2
1.8. Productivity .............................................................................................................. 2
1.9. Easy to integrate ...................................................................................................... 2
1.10. Refactoring ............................................................................................................. 2
1.11. License ................................................................................................................... 2
2. Download ............................................................................................................................ 3
3. Wiki and forum .................................................................................................................. 4
4. How to execute NeoDatis ................................................................................................... 5
5. IDE Integration ................................................................................................................... 6
5.1. Eclipse ...................................................................................................................... 6
6. Migration from previous versions ..................................................................................... 7
7. Storing objects .................................................................................................................... 8
8. Retrieving objects ............................................................................................................. 12
8.1. Retrieving all objects of a specific class ............................................................... 12
8.2. Criteria queries ....................................................................................................... 12
8.2.1. Equality ....................................................................................................... 14
8.2.2. like ............................................................................................................... 14
8.2.3. greater than (gt) .......................................................................................... 15
8.2.4. greater or equal (ge) ................................................................................... 15
8.2.5. less than (lt) ................................................................................................ 16
8.2.6. less or equal (le) ......................................................................................... 16
8.2.7. contain -To test if an array or a collection contains a specific value ........... 17
8.2.8. Null Objects ................................................................................................ 18
8.2.9. Where on collection or array size ............................................................... 18
8.2.10. Logical ...................................................................................................... 18
8.2.11. More criteria query examples ................................................................... 18
8.3. Native Query .......................................................................................................... 19
8.4. Retrieving an object by its OID ............................................................................ 21
8.5. Query tuning .......................................................................................................... 21
8.5.1. Indexes ........................................................................................................ 22
8.5.1.1. Creating an index ............................................................................. 22
8.5.1.2. Checking if an index exists .............................................................. 22
NeoDatis Object Database
NeoDatis 1.9.1 NeoDatis Object Database iii
8.5.1.3. Deleting an index ............................................................................. 22
8.5.1.4. Rebuilding an index ......................................................................... 22
9. Object Values API ............................................................................................................ 23
9.1. Aggregate functions ............................................................................................... 24
9.2. Dynamic Views ...................................................................................................... 27
9.3. Custom Functions .................................................................................................. 28
10. Updating Objects ............................................................................................................ 30
11. Deleting Objects ............................................................................................................. 31
12. Using NeoDatis in client/server mode ............................................................................ 33
13. Reconnecting Objects to Session .................................................................................... 35
14. Database Encoding ......................................................................................................... 36
15. Object Explorer ............................................................................................................... 37
15.1. Browsing data ...................................................................................................... 38
15.1.1. Table View ................................................................................................ 39
15.1.2. Object View .............................................................................................. 39
15.2. Queries ................................................................................................................. 40
15.3. Updating objects .................................................................................................. 41
15.4. Creating new objects ........................................................................................... 43
16. XML ................................................................................................................................ 45
16.1. Using Object Exporer .......................................................................................... 45
16.1.1. Exporting ................................................................................................... 45
16.1.2. Importing ................................................................................................... 45
16.2. Using NeoDatis API ............................................................................................ 46
17. NeoDatis Extended API .................................................................................................. 48
18. User/Password protection ............................................................................................... 49
19. Best practices .................................................................................................................. 50
20. Using NeoDatis in web applications ............................................................................. 51
20.1. Web App Example ............................................................................................... 51
21. Advanced features ........................................................................................................... 53
22. NeoDatis on Google Android ......................................................................................... 55
23. NeoDatis and Groovy ..................................................................................................... 56
24. Annexes ........................................................................................................................... 57
NeoDatis 1.9.1 NeoDatis Object Database 1
Chapter 1. Overview
NeoDatis ODB is an open source Object Oriented Database. It is a real native and transparent
persistence layer for Java, .Net, Groovy, Scala and Google Android.
With NeoDatis ODB you can store and retrieve your objects with a single line of code without
the need of mapping your objects to any table.
So NeoDatis ODB will increase your productivity and let you concentrate on your business
logic.
1.1 Simple
NeoDatis is very simple and intuitive: the learning time is very short. Have a look at the
NeoDatis one minute tutorial to check this. The API is simple and does not require learning
any mapping technique. There is no need for mapping between the native objects and the
persistence store. NeoDatis simply stores the objects the way they are. NeoDatis requires zero
administration and zero installation.
1.2 Small
The NeoDtais runtime is less than 800k and is distributed as a single jar/dll that can easily be
packaged in any type of application.
1.3 Fast
NeoDatis can store more than 30000 objects per second.
1.4 Safe and robust
NeoDatis supports ACID transactions to guarantee data integrity of the database. All committed
work will be applied to the database even in case of hardware failure. This is done by automatic
transaction recovery on the next startup.
1.5 One single database file
NeoDatis uses a single file to store all data:
• The Meta-model
Overview
NeoDatis 1.9.1 NeoDatis Object Database 2
• The Objects
• The indexes
1.6 Multiplatform
NeoDatis works with Java, .Net, Groovy, Scala and Google Andoid
1.7 Data are always available
NeoDatis lets you export all data to a standard XML Format (see Annex 1: Xml Exported file
of the tutorial) which guarantee that data are always available. NeoDatis can also import data
from the same XML format. Import and Export features are available via API or via the Object
Explorer.
1.8 Productivity
NeoDatis lets you persist data with a very few lines of code. There is no need to modify the
classes that must be persisted and no mapping is needed. So developers can concentrate on
business logic implementation instead of wasting time with the persistence layer.
1.9 Easy to integrate
The only requirement to use NeoDatis is to have a single jar/dll on the application classpath/
path.
1.10 Refactoring
NeoDatis currently supports 4 types of refactoring:
• Renaming a class (via API or Object Explorer)
• Renaming a Field (via API or Object Explorer)
• Adding a new Field (automatically detected)
• Removing a Field (automatically detected)
1.11 License
NeoDatis is distributed under the LGPL license.