Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring/Hibernate Entity Management Web Interface/UI

We have a server application that exposes a certain model, and set of services built on that model, to a particular client UI through a number of protocols. This is the kind of server application where, once it's set-up, there's not much manual intervention required. However, once in a while (particularly when the solution is first deployed), there will have to be some creation and linking of certain model objects.

This solution is built on Spring, Spring MVC and Hibernate (amongst other things) using JPA annotations for the ORM stuff.

My question: does anyone know of a framework that will allow me to very quickly set-up (ideally purely through configuration) a web interface to manage (CRUD) entities? This doesn't have to be fancy, and doesn't need to have fancy security (I can handle security from within the application server). It would however need to be able to handle complex relations between entities (collection mappings, enums, etc.).

For example: the application has an entity User, which has the typical Role entity associated with it (each user has 1 Role). Right now, the only way to define this without creating our own web layer from scratch is:

  1. Create SQL statements to import new users (and their roles)
  2. Have some kind of script (using Ant, for example) that uses the Spring/Hibernate configuration to associate and save a new Role() and User() object

Obviously it would be easier if we had a basic web interface (that we don't need to develop ourselves) that comes with the server to handle these kind of tasks (creating, updating, deleting, ...).

like image 909
tmbrggmn Avatar asked Dec 18 '10 19:12

tmbrggmn


3 Answers

Naked Objects, OpenXava and Spring Roo, all can do what you are looking for.

like image 194
Aravind Yarram Avatar answered Oct 20 '22 21:10

Aravind Yarram


Looks like LightAdmin pluggable administration interface for Spring/JPA based applications would be a good choice for you. It has a built-in Java DSL for interface configuration and the only thing you need to do is to download a jar or declare Maven dependency, enable your domain administration through web.xml (point to package containing your JPA entities) and create @Administration configuration for the entity.

Here is an example of configuration:

@Administration( User.class )
public class UserAdministration {

  public static EntityMetadata configuration(EntityMetadataBuilder configurationBuilder ) {
    return configurationBuilder.nameField( "firstname" ).build();
  }

  public static ScreenContext screenContext( ScreenContextBuilder screenContextBuilder ) {
    return screenContextBuilder
           .screenName( "Users Administration" )
           .menuName( "Users" ).build();
  }

  public static FieldSet listView( final FieldSetBuilder fragmentBuilder ) {
    return fragmentBuilder
           .field( "firstname" ).caption( "First Name" )
           .field( "lastname" ).caption( "Last Name" ).build();
  }
like image 20
max-dev Avatar answered Oct 20 '22 20:10

max-dev


I'd try Grails to do this. It's built for fast development of CRUD web applications. It's based on Groovy, Spring, and Hibernate.

like image 2
duffymo Avatar answered Oct 20 '22 20:10

duffymo