Giter Club home page Giter Club logo

springmvc-hibernate-template's Introduction

This is a simple application that demonstrates how to use Spring 3.1 on Cloud Foundry. 

This application builds a transactional service that talks to an RDBMS and is fronted by
an Spring MVC controller which handles RESTful API calls. 

Deployment is easy, and there are a lot of options: 

From an Eclipse environment like the SpringSource Tool Suite equipped with the m2e and Cloud Foundry WTP connector support: 
1) Import the project into Eclipse using the m2e / m2eclipse plugin - File > Import > Maven > Existing Maven Projects. 
2) Setup a Cloud Foundry WTP server pointing to the Cloud Foundry cloud you want to target
3) Drag and drop the application onto the Cloud Foundry WTP instance, and specify that you need a Redis service and a PostgreSQL service and 512M of RAM.

You can use the vmc command line tool, too.
0) you need to change the name of the application as specified in your manifest.yml file, if there's already an existing application deployed under the same name on the Cloud Foundry instance
1) Run 'mvn clean install' on the command line from the root of the project to create a binary. 
2) From the root of the project, run 'vmc --path target/springmvc31-1.0.0 push'

You should also be able to deploy the project using the Maven Cloud Foundry plugin, which is already configured. You need to specify 
connectivity information in your ~/.m2/settings.xml file, as described in http://blog.springsource.org/2011/09/22/rapid-cloud-foundry-deployments-with-maven/ 
0) you need to change the name of the application as specified in your manifest.yml file, if there's already an existing application deployed under the same name on the Cloud Foundry instance
1) from the root of the project, run 'mvn clean install'
2) then run 'mvn cf:push' 



Here are some SQL statements to setup the database:

 H2
 insert into customer (firstname ,lastname ,signupdate ) values( 'Juergen'  , 'Hoeller', NOW()) ;
 insert into customer (firstname ,lastname ,signupdate ) values( 'Mark'  , 'Fisher', NOW()) ;
 insert into customer (firstname ,lastname ,signupdate ) values( 'Chris'  , 'Richardson', NOW()) ;
 insert into customer (firstname ,lastname ,signupdate ) values( 'Josh'  , 'Long', NOW()) ;
 insert into customer (firstname ,lastname ,signupdate ) values( 'Dave'  , 'Syer', NOW()) ;
 insert into customer (firstname ,lastname ,signupdate ) values( 'Matt'  , 'Quinlan', NOW()) ;
 insert into customer (firstname ,lastname ,signupdate ) values( 'Gunnar'  , 'Hillert', NOW()) ;
 insert into customer (firstname ,lastname ,signupdate ) values( 'Dave'  , 'McCrory', NOW()) ;
 insert into customer (firstname ,lastname ,signupdate ) values( 'Raja'  , 'Rao', NOW()) ;
 insert into customer (firstname ,lastname ,signupdate ) values( 'Monica'  , 'Wilkinson', NOW()) ;


 PostgreSQL
 INSERT INTO customer(id, firstname, lastname, signupdate) values( nextval( 'hibernate_sequence') , 'Mark', 'Fisher', NOW()) ;
 INSERT INTO customer(id, firstname, lastname, signupdate) values( nextval( 'hibernate_sequence') , 'Juergen', 'Hoeller', NOW()) ;
 INSERT INTO customer(id, firstname, lastname, signupdate) values( nextval( 'hibernate_sequence') , 'Chris', 'Richardson', NOW()) ;
 INSERT INTO customer(id, firstname, lastname, signupdate) values( nextval( 'hibernate_sequence') , 'Dave', 'Syer', NOW()) ;
 INSERT INTO customer(id, firstname, lastname, signupdate) values( nextval( 'hibernate_sequence') , 'Patrick', 'Chanezon', NOW()) ;
 INSERT INTO customer(id, firstname, lastname, signupdate) values( nextval( 'hibernate_sequence') , 'Gunnar', 'Hiller', NOW()) ;
 INSERT INTO customer(id, firstname, lastname, signupdate) values( nextval( 'hibernate_sequence') , 'Josh', 'Long', NOW()) ;
 INSERT INTO customer(id, firstname, lastname, signupdate) values( nextval( 'hibernate_sequence') , 'Dave', 'McCrory', NOW()) ;
 INSERT INTO customer(id, firstname, lastname, signupdate) values( nextval( 'hibernate_sequence') , 'Raja', 'Rao', NOW()) ;
 INSERT INTO customer(id, firstname, lastname, signupdate) values( nextval( 'hibernate_sequence') , 'Andy', 'Piper', NOW()) ;
 INSERT INTO customer(id, firstname, lastname, signupdate) values( nextval( 'hibernate_sequence') , 'Eric', 'Bottard', NOW()) ;

springmvc-hibernate-template's People

Contributors

joshlong avatar leods avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.