We have a Java application with lots of config tables on the database (Oracle). We'd like to have Web-based GUIs for setting up these tables, that we currently update via SQL queries. What is the simplest way to develop CRUDs for a subset of our database? Is there any Java-based framework for doing this?
IMHO, there is quite a good solution for managing application data without need to write any additional code.
LightAdmin is a pluggable Java library for Spring/JPA backed applications, which provides standard CRUD functionality, filtering, JSR-303 validation through clean and simple UI. It provides DSL for interface customization and you can plug/unplug it from your application whenever you want.
Here is a small example of DSL configuration customization:
@Administration( Booking.class )
public class BookingAdministration {
public static ScopesConfigurationUnit scopes( final ScopesConfigurationUnitBuilder scopeBuilder ) {
return scopeBuilder
.scope( "All", all() )
.scope( "Smoking Apartments", specification( smokingApartmentsSpec( true ) ) )
.scope( "Non Smoking Apartments", specification( smokingApartmentsSpec( false ) ) )
.scope( "Long-term bookings", filter( longTermBookingPredicate() ) ).defaultScope().build();
}
public static FiltersConfigurationUnit filters( final FiltersConfigurationUnitBuilder filterBuilder ) {
return filterBuilder
.filter( "Customer", "user" )
.filter( "Booked Hotel", "hotel" )
.filter( "Check-In Date", "checkinDate" ).build();
}
public static FieldSetConfigurationUnit listView( final FieldSetConfigurationUnitBuilder fragmentBuilder ) {
return fragmentBuilder
.field( "user" ).caption( "Customer" )
.field( "hotel" ).caption( "Hotel" )
.field( "checkinDate" ).caption( "Check-In Date" )
.field( "smoking" ).caption( "Smoking" )
.field( "beds" ).caption( "Beds" )
.build();
}
public static DomainTypePredicate longTermBookingPredicate() {
return new DomainTypePredicate() {
@Override
public boolean apply( final Booking booking ) {
return booking.getNights() > 20;
}
};
}
public static DomainTypeSpecification smokingApartmentsSpec( final boolean isSmokingApartment ) {
return new DomainTypeSpecification() {
@Override
public Predicate toPredicate( final Root root, final CriteriaQuery<?> query, final CriteriaBuilder cb ) {
return cb.equal( root.get( "smoking" ), isSmokingApartment );
}
};
}
}
Telosys Tools ( http://www.telosys.org/ ) has been design for this kind of job.
It uses an existing database to generate source code (typically CRUD screens) And it’s possible to customize the templates if necessary
The best way to try it is to follow the tutorial: https://sites.google.com/site/telosystutorial/
(there’s a stack for Spring MVC / Spring Data / JPA )
See also : http://marketplace.eclipse.org/content/telosys-tools
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With