# Database Schema Definition in Java

> As explained in the Java Quick Start, the JNI uses the Java class syntax, with annotations. At run-time, Java reflection is used to discover the classes with their annotations and build up an eXtremeDB database dictionary. Note that the annotation `@Persistent()` marks a Java class to be managed by the eXtremeDB runtime in an In-Memory Database. (If the database is to be stored on persistent storage, the annotation modifier `@Persistent(disk=true)` must be added.)

> Please refer to the JNI Schema Reference Guide for detailed explanations of the usage of JNI annotations to define the Database, Class, Field and Index characteristics.

> ## Persistent Databases

> For persistent database applications the database classes are defined exactly as for in-memory databases except for the class annotation `@Persistent(disk=true)` for all classes that will be stored on persistent media. For example:

>         @Persistent(disk=true)
>         class Obj
>         {
>             public int i4;
>         };

> If all classes are to be stored on persistent media, an alternative is to use the Database.Parameters property `diskClassesByDefault` for the parameters passed to the Database method `open()`. For example:

>         Database.Parameters parameters = new Database.Parameters();
>         parameters.classes = new Class[]{Obj.class};
>         ...
>         parameters.diskClassesByDefault = true;

>         ...