[Resolved] Any Database Annotation Library?

Hello there,

After a long brake (last time 2013 or so) from Developing Minecraft Plugins im back again and want to Recreate one of my old Plugins for the Sponge API.

I want to save all kind of stuff in a Database (PostgreSQL or MySQL). Right now i just saw the Plain SQL Implementation from Sponge. But is there any Library like SimpleSave from Alta189 where you was able to make Annotation to a Class to get it saved easy?

@Table("Kingdom")
public class Kingdom {

@Id
private int id;

@Field
private String tag;

@Field
private int level = 0;

Or how do you handle it? Some best practices?

Thanks for you help.

I started something like that some time ago… you can experiment with this package - if you want i can also move that code into a separate repository as a library

This is typically part of an ORM. A lot of generic ORM libraries for Java are compatible with any project, including sponge.

If the mentioned one by DosMike doesn’t work, you might want to look up ‘lightweight Java ORM’ or such.

Thanks. i will give http://ormlite.com a try.