Java Schema Definition

Java applications define the database classes to be managed in the eXtremeDB runtime using native Java class syntax applying special annotations.

For example, the following code snippet would define a database with two classes Department and Employee:

 
    @Persistent()
    class Department
    {
        @Indexable(Type = Database.IndexType.BTree, Unique = true)
        public String code;
        public String name;
        @Indexable(Type = Database.IndexType.Hashtable, Unique = true)
        public int dept_no;
    }
     
    @Index("byDept_EmployeeName", Keys = new string[] { "dept_no", "name" }, Unique = false)
     
    @Persistent()
    class Employee
    {
        @Indexable(Type = Database.IndexType.BTree, Unique = true)
        public String  name;
        public int  dept_no;
    }
     

Note that the annotations @Persistent(), @Indexable()and @Index() are used to specify the classes and indexes to be generated and maintained in the database.

eXtremeDB JNI Database Annotations

The annotations that are recognized as eXtremeDB database specifications are as follows: