openxava / documentation / OpenXava with LeanXcale

Tabla of contents

What is LeanXcale?
Sign up for LeanXcale
What is OpenXava?
Sign up and download OpenXava Studio
Create new OpenXava project
Config OpenXava for LeanXcale
Rebuild the project
Run application

What is LeanXcale?

LeanXcale is an ACID database engine that scales linearly and flexibly from a single node up to hundreds of nodes and boasts a key–value API with single-digit millisecond latency and maintains the same performance for large volumes.
LeanXcale can scale linearly as your business grows; from the MVP to global deployment, also provides a fast and flexible platform with a 360º view of all available information.

Sign up for LeanXcale

LeanXcale provides a trial version without the need to provide any information. You just need to register with your email here
In few minutes you will receive an email to activate the trial version and it will take you directly to the LeanXcale platform.

What is OpenXava?

OpenXava is a Java open-source framework with high productivity, focused on the development of enterprise web application adaptable to multiplatform and supports practically all relational databases.

Sign up and download OpenXava Studio

OpenXava is free and you can download the Studio sign up here or you can use another IDE such as IntelliJ, VSC with Maven. once registered, you will receive an email with a link to download the Studio, below we will use this IDE.

Create new OpenXava project

First you have to click on OpenXava > New OpenXava Project and a window will pop up
Open the src/main/java folder, there select the com.yourcompany.invoicing.model package and click on New Java Class button:
Then type Customer as class name and press Finish.
Copy the following code in Customer:
package com.yourcompany.invoicing.model;
import javax.persistence.*;
import org.openxava.annotations.*;
import lombok.*;
@Getter @Setter
public class Customer {
    int number;
    String name;

Config OpenXava for LeanXcale

Edit the pom.xml file in the project root folder and add the following dependencies in <dependencies>:

In the same file, add the following repository in <repositories>:
It would be something like this:
Would remain to add a property in persistence.xml located in src/main/resources/META-INF folder:
      <!-- ... -->
      <property name="hibernate.dialect" value="com.leanxcale.connector.hibernate.LxDialect"/>
      <property name="hibernate.globally_quoted_identifiers" value="true"/>
Now go to LeanXcale platform, "How To Connect" and copy the url:
Then edit the context.xml file located in src/main/webapp/MEFA-INF folder:
<Resource name="jdbc/invoicingDS" auth="Container" type="javax.sql.DataSource"
	  maxTotal="20" maxIdle="5" maxWaitMillis="10000"
	  username="app" password="app" 
Obviously, you have to adapt it to your project. change the username, password(if you are using trial version, user/password is "app"), in the url paste the one you copied on the LeanXcale platform.

Rebuild the project

After the changes you have to rebuild your project. In OpenXava Studio click with right mouse button on your project an choose Run As > Maven install, thus:

Optimization note: Instead of a mvn install, that do a complete Maven build, you can use mvn war:exploded, enough to apply the above changes for development. You can run mvn war:exploded from OpenXava Studio with Run As > Maven build... and typing war:exploded for goal.

Run application

Click on the Run button:
Wait until the console shows a message saying "Application started", like this:
Then your application is already running. To check this, open your favorite browser (Chrome, Firefox, Edge or Safari) and go to the next URL:


You get your application running for the first time. To start click on SIGN IN button
Now, enter admin/admin and click on SIGN IN:
Página de identificación
Then on top the left you will have a list of modules, choose Customers:
Use the Customers module to create new customers, just enter number and name and press Save.
Click on List to see the list of created customers. Congratulations, you have your first OpenXava application running.

Do you like OpenXava and want more details? We invite you to watch lesson 1
Did you have problems with OpenXava? Ask in the forum