Here some citation from why-another-orm.txt included in ActiveObjects-core:
ActiveObjects is designed from
the ground up to be as easy to use as possible, with a bare minimum of
configuration....There is an increasing trend in the industry towards "convention over
configuration."...
In fact, ActiveObjects strives so hard to be a simple and easy-to-use
persistence framework that some functionality (such as distributed transactions)
has been simply omitted. The reasoning behind this is that 99% of use-cases
do not call for such extreme measures. If your project does require such
complex behavior within your ORM, you should be using Hibernate. It's as
simple as that. ActiveObjects is not intended to supplant Hibernate.
Rather, its goal is to be an easier and lighter alternative for the many
common scenarios which do not call for all of Hibernate's awesome power.
In short, ActiveObjects attempts to make database development simple
and fun again.
Consider companies like Atlassian using ActiveObjects in JIRA.
Here's an example of using ActiveObjects:
Repositories:
https://maven2-repository.dev.java.net/
Use the following dependencies:
<dependency>
<groupId>net.java.dev.activeobjects</groupId>
<artifactId>activeobjects</artifactId>
<version>0.8.2</version>
</dependency>
Create the following files:
Entity.java
import net.java.ao.RawEntity;
import net.java.ao.schema.AutoIncrement;
import net.java.ao.schema.NotNull;
import net.java.ao.schema.PrimaryKey;
public interface Entity extends RawEntity<Integer>{
@AutoIncrement
@NotNull
@PrimaryKey("id")
Integer getExportId();
}
TestAO.java
import net.java.ao.Preload;
import java.sql.Timestamp;
@Preload
public interface TestAO extends Entity {
String getFirstName();
void setFirstName(String firstName);
String getLastName();
void setLastName(String lastName);
Timestamp getUpdateTimestamp();
void setUpdateTimestamp(Timestamp updateTimestamp);
}
Test.java
EntityManager entityManager = EntityManager("jdbc:mysql://localhost:3306/test","test","test");
ao.migrate(TestAO.class);
TestAO testAO = ao.create(TestAO.class);
testAO.setFirstName("firstName");
testAO.setLastName("lastName");
testAO.save();