<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7942628804873074318</id><updated>2024-11-01T01:43:53.203-07:00</updated><category term="Spring"/><category term="Vaadin"/><category term="Hibernate"/><category term="crud"/><category term="Java"/><category term="github"/><category term="maven"/><category term="GWT"/><category term="applicationContext"/><category term="autowired"/><category term="integración"/><category term="netbeans"/><category term="properties"/><category term="rest"/><category term="servlet"/><category term="webserice"/><title type='text'>Vaadin Spring e Hibernate</title><subtitle type='html'>Vaadin Spring e Hibernate</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vaadinspringhibernate.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://vaadinspringhibernate.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7942628804873074318.post-2267239093649899118</id><published>2015-02-21T12:11:00.003-08:00</published><updated>2018-04-15T15:12:31.693-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="rest"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><category scheme="http://www.blogger.com/atom/ns#" term="webserice"/><title type='text'>Servicio REST</title><content type='html'>&lt;b&gt;SERVICIO REST&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Continuando con el proyecto anterior &lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/menu.html&quot;&gt;Vaadin,Spring,Hibernate &lt;/a&gt;vamos a crear un servicio REST sencillo donde listemos los usuarios de la BD, todo esto utilizando Spring. (Para saber que es REST remitirse al &lt;a href=&quot;http://es.wikipedia.org/wiki/Representational_State_Transfer&quot;&gt;link&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
Ya antes en el archivo web.xml habiamos mapeado la clase&amp;nbsp;org.springframework.web.servlet.DispatcherServlet de Spring y estaba mapeada algo asì:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicGDyqttMMz9699QEbkzSpb_vVYVWXW76c87PTXRjO1hUpOM-0XseBAh962QeRH6fJ8ZJ9sbfJyx6_93hA4uAZ8yRHH68HWqrmLfOMJXhVG0xA9FBs4OhUMhZvDEStBvmOyel8wB6ZHDpd/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;servlet-mapping&amp;gt;  
     &amp;lt;servlet-name&amp;gt;dispatcher&amp;lt;/servlet-name&amp;gt;  
     &amp;lt;url-pattern&amp;gt;/html/*&amp;lt;/url-pattern&amp;gt;  
   &amp;lt;/servlet-mapping&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Y tenemos el archivo asociado dispatcher-servlet.xml donde definimos diferentes View Resolver, entre ellos para json y xml.
&lt;br /&gt;
&lt;br /&gt;
Teniendo lo anterior podemos crear la siguiente clase:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicGDyqttMMz9699QEbkzSpb_vVYVWXW76c87PTXRjO1hUpOM-0XseBAh962QeRH6fJ8ZJ9sbfJyx6_93hA4uAZ8yRHH68HWqrmLfOMJXhVG0xA9FBs4OhUMhZvDEStBvmOyel8wB6ZHDpd/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 400px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; package com.ejemplo.vaadin.rest;  
 import com.ejemplo.vaadin.dao.DaoUsuario;  
 import com.ejemplo.vaadin.entidades.Usuario;  
 import java.util.ArrayList;  
 import java.util.List;  
 import javax.servlet.http.HttpServletRequest;  
 import javax.servlet.http.HttpServletResponse;  
 import org.springframework.beans.factory.annotation.Autowired;  
 import org.springframework.stereotype.Controller;  
 import org.springframework.web.bind.annotation.RequestMapping;  
 import org.springframework.web.bind.annotation.RequestMethod;  
 import org.springframework.web.servlet.ModelAndView;  
 /**  
  *  
  * @author josorio  
  */  
 @Controller  
 public class UsuariosController {  
   @Autowired  
   private DaoUsuario daoUsuario;  
   /**  
    * Lista todos los usuarios de la BD  
    * @param request  
    * @param response  
    * @return   
    */  
   @RequestMapping( method = {RequestMethod.GET}, value = &quot;/listarusuarios&quot; )  
   public ModelAndView obtener10Parqueaderos(HttpServletRequest request, HttpServletResponse response)  
   {  
     ModelAndView retorno = new ModelAndView();  
     List&amp;lt;Usuario&amp;gt; listaEntidades;  
     try{        
       listaEntidades = daoUsuario.listar();  
       if( listaEntidades == null )  
       {  
         listaEntidades = new ArrayList&amp;lt;Usuario&amp;gt;();  
       }  
     }catch(Exception e){  
       System.out.println(&quot;Error &quot;+e.getMessage());  
       listaEntidades = new ArrayList&amp;lt;Usuario&amp;gt;();  
     }  
     retorno.addObject( &quot;cantidad&quot;, listaEntidades.size() );  
     retorno.addObject( &quot;datos&quot;, listaEntidades );  
     return retorno;  
   }  
 }  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Ya con esto y si visitamos las urls:&lt;br /&gt;
../MavenEjemplo/html/listarusuarios.xml ó&amp;nbsp;/MavenEjemplo/html/listarusuarios.json veremos nuestro webservice tipo REST corriendo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: arial, tahoma, helvetica, freesans, sans-serif; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: right; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
Visita también&lt;/div&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
&lt;a href=&quot;https://joarchitectus.wordpress.com/&quot;&gt;https://joarchitectus.wordpress.com&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
&lt;a href=&quot;https://joarchitectus.wordpress.com/2018/03/23/vaadin-spring-e-hibernate/&quot;&gt;https://joarchitectus.wordpress.com/2018/03/23/vaadin-spring-e-hibernate/&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vaadinspringhibernate.blogspot.com/feeds/2267239093649899118/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2015/02/servicio-rest.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/2267239093649899118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/2267239093649899118'/><link rel='alternate' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2015/02/servicio-rest.html' title='Servicio REST'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7942628804873074318.post-9132295305678048816</id><published>2011-04-14T12:57:00.000-07:00</published><updated>2018-04-15T15:12:54.066-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="crud"/><category scheme="http://www.blogger.com/atom/ns#" term="github"/><category scheme="http://www.blogger.com/atom/ns#" term="Hibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="maven"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><category scheme="http://www.blogger.com/atom/ns#" term="Vaadin"/><title type='text'>Menú - Vaadin, Spring e Hibernate</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiizSptfNnpZY6NV9E2naPczEkMLfP2vDtiTJ4o0fgvzB7fCqcyEe35zUBYqQmLQM6w2dP_O0zRb6mgwM58JCrY-R0bXhGstYZJ5KY5fgAMHoIB5XlSiOM1hG98Ni8nZs-x1HEQzYtdZN3i/s1600/vaadinspringhibernate.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5595533247323642818&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiizSptfNnpZY6NV9E2naPczEkMLfP2vDtiTJ4o0fgvzB7fCqcyEe35zUBYqQmLQM6w2dP_O0zRb6mgwM58JCrY-R0bXhGstYZJ5KY5fgAMHoIB5XlSiOM1hG98Ni8nZs-x1HEQzYtdZN3i/s320/vaadinspringhibernate.png&quot; style=&quot;cursor: hand; cursor: pointer; display: block; height: 108px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;El objetivo de este post es crear un proyecto sencillo utilizando los framerworks Java: Vaadin, Spring e Hibernate de manera intregrada usando el modelo MVC, el cual se ha dividido en los siguientes capítulos:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;ol style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/vaadin-spring-e-hibernate.html&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Inicio&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;color: #333333; margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/configuracion-inicial.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;Configuración Inicial&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;color: #333333; margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;CRUD - Hibernate - Modelo&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;color: #333333; margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-servicios-spring.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;CRUD - Spring &lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;color: #333333; margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-vaadin-vista.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;CRUD - Vaadin - Vista&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2015/02/servicio-rest.html&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;REST service&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18px;&quot;&gt;
&lt;span style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18px;&quot;&gt;
&lt;span style=&quot;font-size: 13px;&quot;&gt;El código del proyecto lo pueden encontrar en github construido con maven&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;a href=&quot;https://github.com/juliandresog/VaadinEjemplo.git&quot;&gt;https://github.com/juliandresog/VaadinEjemplo.git&amp;nbsp;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;En la misma linea que este blog esta el siguiente, el cual apunta a usar Sencha GXT&amp;nbsp;&lt;a href=&quot;http://senchagxtspringhibernate.blogspot.com/&quot;&gt;http://senchagxtspringhibernate.blogspot.com/&amp;nbsp;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Visita también&lt;br /&gt;
&lt;a href=&quot;https://joarchitectus.wordpress.com/2018/03/23/vaadin-spring-e-hibernate/&quot;&gt;https://joarchitectus.wordpress.com/2018/03/23/vaadin-spring-e-hibernate/&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18px; text-align: right;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Julián Andrés Osorio Galvis&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vaadinspringhibernate.blogspot.com/feeds/9132295305678048816/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2011/04/menu.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/9132295305678048816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/9132295305678048816'/><link rel='alternate' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2011/04/menu.html' title='Menú - Vaadin, Spring e Hibernate'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiizSptfNnpZY6NV9E2naPczEkMLfP2vDtiTJ4o0fgvzB7fCqcyEe35zUBYqQmLQM6w2dP_O0zRb6mgwM58JCrY-R0bXhGstYZJ5KY5fgAMHoIB5XlSiOM1hG98Ni8nZs-x1HEQzYtdZN3i/s72-c/vaadinspringhibernate.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7942628804873074318.post-2057575142176469431</id><published>2011-04-14T12:19:00.000-07:00</published><updated>2015-02-21T11:32:46.001-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="crud"/><category scheme="http://www.blogger.com/atom/ns#" term="github"/><category scheme="http://www.blogger.com/atom/ns#" term="Hibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="maven"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><category scheme="http://www.blogger.com/atom/ns#" term="Vaadin"/><title type='text'>CRUD Ejemplo - Vaadin - Vista</title><content type='html'>&lt;div&gt;
En esta parte crearemos la interfaz web usando el framework Vaadin, aca crearemos un formulario básico con los campos necesarios para crear un registro de un usuario.&lt;br /&gt;
&lt;br /&gt;
Ahora para crear la parte de la vista web del aplicativo modifico la clase MyApplication.java para que quede de la siguiente manera:&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 400px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; /*
* MyApplication.java
*
* Created on 12 de abril de 2011, 04:09 PM
*/
package com.ejemplo.vaadin;
import com.ejemplo.vaadin.admusuarios.FormularioUsuario;
import com.ejemplo.vaadin.servicios.ServicioUsuarios;
import com.vaadin.Application;
import com.vaadin.ui.*;
import com.vaadin.data.*;
import org.springframework.beans.factory.annotation.Autowired;
/**
*
* @author josorio
* @version
*/
public class MyApplication extends Application {
@Autowired
ServicioUsuarios servicioUsuarios;
@Override
public void init() {
Window mainWindow = new Window(&quot;MyApplication&quot;);
Label label = new Label(&quot;Ejemplo de Vaadin, Spring e Hibernate&quot;);
mainWindow.addComponent(label);
FormularioUsuario formUsuario = new FormularioUsuario();
mainWindow.addComponent(formUsuario);
setMainWindow(mainWindow);
}
/**
* Método qu retorno el objeto injectado para que otras clases de la aplicación puedan usarlo
* @return El objeto ServicioUsuario injectado
*/
public ServicioUsuarios getServicioUsuarios() {
return servicioUsuarios;
}
}&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Finalmente creo el formulario en Vaadin con los campos necesarios para registrar el usuario:&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 400px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.ejemplo.vaadin.admusuarios;
import com.ejemplo.vaadin.MyApplication;
import com.ejemplo.vaadin.entidades.Usuario;
import com.vaadin.data.Property;
import com.vaadin.data.validator.EmailValidator;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Form;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Window.Notification;
@SuppressWarnings(&quot;serial&quot;)
public class FormularioUsuario extends Form {
/** Caja de texto para ingresar los nombres del usuario */
TextField txtNombres;
/** Caja de texto para ingresar los apellidos del usuario */
TextField txtApellidos;
/** Caja de texto para ingresar el correo del usuario */
TextField txtCorreo;
/** Caja de texto para ingresar la clave para el usuario*/
TextField txtClave;
/** Botón para realizar la acción de guardado */
Button btnGuardar;
public FormularioUsuario() {
txtNombres = new TextField(&quot;Nombres&quot;);
txtNombres.setDescription(&quot;Ingrese los nombres del usuario&quot;);
txtNombres.setRequired(true);
txtNombres.setRequiredError(&quot;Debe ingresar los nombres del usuario&quot;);
txtApellidos = new TextField(&quot;Apellidos&quot;);
txtApellidos.setDescription(&quot;Ingrese los apellidos del usuario&quot;);
txtApellidos.setRequired(true);
txtApellidos.setRequiredError(&quot;Debe ingresar los apellidos del usuario&quot;);
txtCorreo = new TextField(&quot;Correo&quot;);
txtCorreo.setDescription(&quot;Ingrese el correo electronico del usuario&quot;);
txtCorreo.setRequired(true);
txtCorreo.setRequiredError(&quot;El correo es un campo obligatorio, por favor ingrese un valor&quot;);
txtCorreo.addValidator(new EmailValidator(&quot;Debe ingresar una dirección de correo válida&quot;));
txtClave = new TextField(&quot;Clave&quot;);
txtClave.setDescription(&quot;Ingrese la clave para el usuario&quot;);
txtClave.setRequired(true);
txtClave.setRequiredError(&quot;Debe ingresar una clave para el usuario&quot;);
addField(&quot;txtNombres&quot;, txtNombres);
addField(&quot;txtApellidos&quot;, txtApellidos);
addField(&quot;txtCorreo&quot;, txtCorreo);
addField(&quot;txtClave&quot;, txtClave);
btnGuardar = new Button(&quot;Guardar Usuario&quot;);
btnGuardar.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
if (isValid()) {
 Usuario usuario = formularioAEntidad();
 //ejecuto el guardado
 Integer respuesta = ((MyApplication) getApplication()).getServicioUsuarios().guardarUsuario(usuario);
 switch (respuesta.intValue()) {
   // Si la solicitud se procesó bien
   case 0:
     getWindow().showNotification(&quot;Se ha guardado el usuario correctamente&quot;);
     //Reseteamos el formulario para que quede limpio
     reset();
     break;
   // Si el usuario no existe
   case 1:
     getWindow().showNotification(&quot;Al parecer usted no &quot;
         + &quot;cuenta con privilegios para realizar ésta acción&quot;, Notification.TYPE_WARNING_MESSAGE);
     break;
   // Si se presentó un error
   case 2:
     getWindow().showNotification(&quot;No se ha encontrado una sesión activa &quot;
         + &quot;al procesar la solicitud&quot;, Notification.TYPE_ERROR_MESSAGE);
     break;
   //si excepcion de duplicate data
   case 4:
     getWindow().showNotification(&quot;Ya existe un usuario definido para este correo!&quot;, Notification.TYPE_ERROR_MESSAGE);
     break;
   // Si el resultado no es el esperado
   default:
     getWindow().showNotification(&quot;El servidor respondió &quot;
         + &quot;de forma inesperada, por favor &quot;
         + &quot;reporte este mensaje de error&quot;, Notification.TYPE_ERROR_MESSAGE);
 }
} else {
 getWindow().showNotification(&quot;Por favor ingrese todos los datos marcados con * &quot;
     + &quot;en el formulario&quot;, Notification.TYPE_ERROR_MESSAGE);
}
}
});
addField(&quot;btnGuardar&quot;, btnGuardar);
}
/**
* Método para cargar el formulario con los datos del objeto parámetro
* @param usuario - Entidad usuario
*/
public void entidadAFormuario(Usuario usuario) {
txtNombres.setValue(usuario.getNombres());
txtApellidos.setValue(usuario.getApellidos());
txtCorreo.setValue(usuario.getCorreo());
}
/**
* Método para crear una entidad con los datos ingresados al formulario
* @return El usuario creado
*/
public Usuario formularioAEntidad() {
Usuario retorno;
retorno = new Usuario();
retorno.setClave((txtClave.getValue().toString()));
retorno.setNombres(txtNombres.getValue().toString());
retorno.setApellidos(txtApellidos.getValue().toString());
retorno.setCorreo(txtCorreo.getValue().toString());
return retorno;
}
/**
* Resetear contenido formulario.
*/
public void reset() {
txtNombres.setValue(&quot;&quot;);
txtApellidos.setValue(&quot;&quot;);
txtCorreo.setValue(&quot;&quot;);
txtClave.setValue(&quot;&quot;);
}
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Ya tenemos todo el código necesario para ejecutar la aplicación, al hacerlo veremos la siguiente pantalla:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwV6JeRpgVWH3vNTuxagEJBQ3n0ioym1-4BEs7-VUzLieYa5vZUIUJVTmBfgpje067iGWYh5r5ifpWjzTvpCHlQuKGjhsSaTQPVyD6xm-Rn16dSTQuFsmzgPfzhG3KWTy6JLuH6Fk9PED4/s1600/antesadmneg22.jpeg&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwV6JeRpgVWH3vNTuxagEJBQ3n0ioym1-4BEs7-VUzLieYa5vZUIUJVTmBfgpje067iGWYh5r5ifpWjzTvpCHlQuKGjhsSaTQPVyD6xm-Rn16dSTQuFsmzgPfzhG3KWTy6JLuH6Fk9PED4/s320/antesadmneg22.jpeg&quot; id=&quot;BLOGGER_PHOTO_ID_5595527940939014578&quot; style=&quot;cursor: hand; cursor: pointer; display: block; height: 180px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCok18GltjnQdzB4L9Di3xtaMMOBenvHX0of13Fgd2JkW4gxiUWhCiH9reyphXl0Jq9IdF04MDiBdR6aFL2DUU79K4UmmTFVA5GgZ3TSX8-G9i2rfjEbBBjTYEbyjZD7He8sxoq69WMZjI/s1600/antesadmneg21.jpeg&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCok18GltjnQdzB4L9Di3xtaMMOBenvHX0of13Fgd2JkW4gxiUWhCiH9reyphXl0Jq9IdF04MDiBdR6aFL2DUU79K4UmmTFVA5GgZ3TSX8-G9i2rfjEbBBjTYEbyjZD7He8sxoq69WMZjI/s320/antesadmneg21.jpeg&quot; id=&quot;BLOGGER_PHOTO_ID_5595527835882098130&quot; style=&quot;cursor: hand; cursor: pointer; display: block; height: 180px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;La estructura final del proyecto es la siguiente:&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXjns9iFp9ooTFNtypDPrrTb3VY6zcI3uRz-kggFIMGRFUQTH908kh1fvGIuRZEp6e-4cZSjFvq_E_WdWwJC7s_p2R-yhIDk8Sh7lomZgKR57cEsCv75RdA4MmFzWqB6Xpq67QE2N1Qz7Y/s1600/proyecto.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXjns9iFp9ooTFNtypDPrrTb3VY6zcI3uRz-kggFIMGRFUQTH908kh1fvGIuRZEp6e-4cZSjFvq_E_WdWwJC7s_p2R-yhIDk8Sh7lomZgKR57cEsCv75RdA4MmFzWqB6Xpq67QE2N1Qz7Y/s320/proyecto.png&quot; id=&quot;BLOGGER_PHOTO_ID_5595529262048092530&quot; style=&quot;cursor: hand; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 179px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
En GitHub pueden encontrar el código fuente construido usando maven&lt;br /&gt;
&lt;a href=&quot;https://github.com/juliandresog/VaadinEjemplo.git&quot;&gt;https://github.com/juliandresog/VaadinEjemplo.git&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Volver al &lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/vaadin-spring-e-hibernate.html&quot;&gt;menú&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;Menú&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/configuracion-inicial.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;Configuración Inicial&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;CRUD - Hibernate - Modelo&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-servicios-spring.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;CRUD - Spring - Controlador&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-vaadin-vista.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;&lt;b&gt;CRUD - Vaadin - Vista&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vaadinspringhibernate.blogspot.com/feeds/2057575142176469431/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-vaadin-vista.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/2057575142176469431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/2057575142176469431'/><link rel='alternate' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-vaadin-vista.html' title='CRUD Ejemplo - Vaadin - Vista'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwV6JeRpgVWH3vNTuxagEJBQ3n0ioym1-4BEs7-VUzLieYa5vZUIUJVTmBfgpje067iGWYh5r5ifpWjzTvpCHlQuKGjhsSaTQPVyD6xm-Rn16dSTQuFsmzgPfzhG3KWTy6JLuH6Fk9PED4/s72-c/antesadmneg22.jpeg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7942628804873074318.post-6847451027420950544</id><published>2011-04-14T12:09:00.000-07:00</published><updated>2011-08-10T16:00:22.325-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="crud"/><category scheme="http://www.blogger.com/atom/ns#" term="Hibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><category scheme="http://www.blogger.com/atom/ns#" term="Vaadin"/><title type='text'>CRUD Ejemplo - Spring</title><content type='html'>Ahora vamos a crear un bean para gestionar las operaciones a nivel de controlador, el cual definimos en el applicationContext.xml asi:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;bean class=&quot;com.ejemplo.vaadin.servicios.impl.ServicioUsuariosImpl&quot; id=&quot;servicioUsuarios&quot;&amp;gt;&amp;lt;/bean&amp;gt;  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;Este bean tiene inyectado el daoUsuarios y sirve de intermediario entre entre la vista y el modelo, que en este caso solo va a guardar una entidad usuario en la BD.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Este bean  contiene el siguiente código:&lt;/div&gt;&lt;pre style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:400px;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; /*&lt;br /&gt;* To change this template, choose Tools | Templates&lt;br /&gt;* and open the template in the editor.&lt;br /&gt;*/&lt;br /&gt;package com.ejemplo.vaadin.servicios;&lt;br /&gt;import com.ejemplo.vaadin.entidades.Usuario;&lt;br /&gt;import java.util.List;&lt;br /&gt;/**&lt;br /&gt;* Servicio con los metodos necesarios para gestionar los usuarios en la BD&lt;br /&gt;* @author josorio&lt;br /&gt;*/&lt;br /&gt;public interface ServicioUsuarios&lt;br /&gt;{&lt;br /&gt;/**&lt;br /&gt;* Método para retornar una lista con todos los usuarios activos(no eliminados)&lt;br /&gt;* en la base de datos&lt;br /&gt;* @return Una lista con todos los usuarios en la BD&lt;br /&gt;*/&lt;br /&gt;public List&amp;lt;Usuario&amp;gt; usuarios();&lt;br /&gt;/**&lt;br /&gt;* Guarda el usuario entregado, si no existía lo crea&lt;br /&gt;* @param usuario&lt;br /&gt;* @return Alguno de los siguientes valores:&lt;br /&gt;* &amp;lt;ul&amp;gt;&lt;br /&gt;* &amp;lt;li&amp;gt;0: En caso de crear el usuario exitosamente&amp;lt;/li&amp;gt;&lt;br /&gt;* &amp;lt;li&amp;gt;1: En caso de el usuario no tener privilegios&amp;lt;/li&amp;gt;&lt;br /&gt;* &amp;lt;li&amp;gt;2: En caso de no haber sesión&amp;lt;/li&amp;gt;&lt;br /&gt;* &amp;lt;li&amp;gt;3: En caso de error&amp;lt;/li&amp;gt;&lt;br /&gt;* &amp;lt;/ul&amp;gt;&lt;br /&gt;*/&lt;br /&gt;public Integer guardarUsuario( Usuario usuario );&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:400px;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; /*&lt;br /&gt;* To change this template, choose Tools | Templates&lt;br /&gt;* and open the template in the editor.&lt;br /&gt;*/&lt;br /&gt;package com.ejemplo.vaadin.servicios.impl;&lt;br /&gt;import com.ejemplo.vaadin.dao.DaoUsuario;&lt;br /&gt;import com.ejemplo.vaadin.entidades.Usuario;&lt;br /&gt;import com.ejemplo.vaadin.servicios.ServicioUsuarios;&lt;br /&gt;import java.io.Serializable;&lt;br /&gt;import java.sql.BatchUpdateException;&lt;br /&gt;import java.sql.SQLException;&lt;br /&gt;import java.util.ArrayList;&lt;br /&gt;import java.util.Date;&lt;br /&gt;import java.util.List;&lt;br /&gt;import org.apache.commons.lang.exception.ExceptionUtils;&lt;br /&gt;import org.hibernate.exception.ConstraintViolationException;&lt;br /&gt;import org.springframework.beans.factory.annotation.Autowired;&lt;br /&gt;import org.springframework.dao.DataIntegrityViolationException;&lt;br /&gt;public class ServicioUsuariosImpl implements ServicioUsuarios, Serializable&lt;br /&gt;{&lt;br /&gt;@Autowired&lt;br /&gt;DaoUsuario daoUsuarios;&lt;br /&gt;/** @{inheritDoc} */&lt;br /&gt;public List&amp;lt;Usuario&amp;gt; usuarios()&lt;br /&gt;{&lt;br /&gt;List&amp;lt;Usuario&amp;gt; retorno = null;&lt;br /&gt;retorno = daoUsuarios.getActivos();&lt;br /&gt;if( retorno == null )&lt;br /&gt;{&lt;br /&gt;retorno = new ArrayList&amp;lt;Usuario&amp;gt;();&lt;br /&gt;}&lt;br /&gt;return retorno;&lt;br /&gt;}&lt;br /&gt;/** @{inheritDoc} */&lt;br /&gt;public Integer guardarUsuario( Usuario usuario )&lt;br /&gt;{&lt;br /&gt;Integer retorno = 1;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;daoUsuarios.guardar( usuario );&lt;br /&gt;retorno = 0;&lt;br /&gt;}catch (ConstraintViolationException e) {&lt;br /&gt;retorno = 4;&lt;br /&gt;} catch (DataIntegrityViolationException e) {&lt;br /&gt;retorno = 4;&lt;br /&gt;}&lt;br /&gt;catch( Exception e )&lt;br /&gt;{&lt;br /&gt;e.printStackTrace();&lt;br /&gt;retorno = 3;&lt;br /&gt;}&lt;br /&gt;return retorno;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Este servicio es inyectado del lado de la vista para administrar los usuarios.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Siguiente: &lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-vaadin-vista.html&quot;&gt;Vista&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Volver al &lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/vaadin-spring-e-hibernate.html&quot;&gt;menú&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 51, 51);   line-height: 18px; font-family:Arial, Tahoma, Helvetica, FreeSans, sans-serif;font-size:13px;&quot;  &gt;&lt;div style=&quot;text-align: justify; &quot;&gt;&lt;b&gt;Menú&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify; &quot;&gt;&lt;ol&gt;&lt;li style=&quot;padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.25em; margin-left: 0px; text-indent: 0px; &quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/configuracion-inicial.html&quot; style=&quot;text-decoration: none; color: rgb(41, 170, 225); &quot;&gt;Configuración Inicial&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;&lt;li style=&quot;padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.25em; margin-left: 0px; text-indent: 0px; &quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo.html&quot; style=&quot;text-decoration: none; color: rgb(41, 170, 225); &quot;&gt;CRUD - Hibernate - Modelo&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;&lt;li style=&quot;padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.25em; margin-left: 0px; text-indent: 0px; &quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-servicios-spring.html&quot; style=&quot;text-decoration: none; color: rgb(41, 170, 225); &quot;&gt;CRUD - Spring - Controlador&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;&lt;li style=&quot;padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.25em; margin-left: 0px; text-indent: 0px; &quot;&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-vaadin-vista.html&quot; style=&quot;text-decoration: none; color: rgb(41, 170, 225); &quot;&gt;&lt;b&gt;CRUD - Vaadin - Vista&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vaadinspringhibernate.blogspot.com/feeds/6847451027420950544/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-servicios-spring.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/6847451027420950544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/6847451027420950544'/><link rel='alternate' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-servicios-spring.html' title='CRUD Ejemplo - Spring'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7942628804873074318.post-2855086301454464379</id><published>2011-04-14T09:28:00.002-07:00</published><updated>2015-02-21T10:35:40.732-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="crud"/><category scheme="http://www.blogger.com/atom/ns#" term="Hibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><category scheme="http://www.blogger.com/atom/ns#" term="Vaadin"/><title type='text'>CRUD Ejemplo - Hibernate - Modelo</title><content type='html'>&lt;div&gt;
Para empezar a trabajar y previa &lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/configuracion-inicial.html&quot;&gt;configuración&lt;/a&gt; del proyecto es necesario añadir las librerías que se muestran en la siguiente pantalla:&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3H9A8FJAMM38rvgQPAXxWvlvPItCq5GfUr4pPIBp8yNORBx2x4RzMqSdqDFPfrM_Wjyt-U3URxcXIqMfA4RVphajpjgInz7UdSD2WbDT_bedEWbxKEGehUa1mN0xNevKwnpnE9edGI0D2/s1600/antesadmneg19.jpeg&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3H9A8FJAMM38rvgQPAXxWvlvPItCq5GfUr4pPIBp8yNORBx2x4RzMqSdqDFPfrM_Wjyt-U3URxcXIqMfA4RVphajpjgInz7UdSD2WbDT_bedEWbxKEGehUa1mN0xNevKwnpnE9edGI0D2/s320/antesadmneg19.jpeg&quot; id=&quot;BLOGGER_PHOTO_ID_5595492330118073634&quot; style=&quot;cursor: hand; cursor: pointer; display: block; height: 180px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3V0jcdSXbm0EEEjZ_JS-F8dvZndusLbFiY7z_DvB_SMXeZ_cotEGK2YptK-Ml1f15UgHa0ZVud_Rby75m5_ufFszDuHOfPLBNc5oS7l8Fla7T-GHsIhLPS8EdwZqh0Pj4EO9FaVmSE1rn/s1600/antesadmneg19.jpeg&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
Este ejemplo lo haremos sobre una base de datos postgres en donde crearemos la siguiente tabla:&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 400px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; CREATE TABLE usuario
(
id serial NOT NULL,
nombres character varying(200) NOT NULL,
apellidos character varying(200) NOT NULL,
correo character varying(200) NOT NULL,
clave character varying(200) NOT NULL,
llave_cambio_clave character varying(200),
fechainactivado timestamp without time zone,
rol integer,
fecha_creacion timestamp without time zone,
bloqueo integer,
CONSTRAINT usuario_pkey PRIMARY KEY (id)
)&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;
Para lo anterior si en el archivo aplication.properties ponemos la siguiente propiedad:&lt;br /&gt;
hibernate.hbm2ddl.auto=update con el campo update estamos indicando que al desplegar el war se actualice el esquema de base de datos según el modelo de entidades que definamos.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
Ahora creo un DAO (&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;&lt;b&gt;Data Access Object&lt;/b&gt;&lt;/span&gt;) genérico para trabajar así:&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 400px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.ejemplo.vaadin.dao;
import org.springframework.dao.DataAccessException;
import java.util.List;
/**
* (DAO, Objeto de Acceso a Datos)
* Componente de acceso a datos reutilizable para no reescribir las
* operaciones basicas sobre los objetos del dominio.
* @param &amp;lt;T&amp;gt;
*/
public interface DaoGenerico&amp;lt;T extends Object&amp;gt; {
/**
* Permite cargar una entidad de manera generica
* @param id el id de la entidad a cargar
* @return La entidad cargada
* @throws DataAccessException
*/
public T getById(int id) throws DataAccessException;
/**
* Permite guardar una entidad de manera generica
* @param entidad la entidad a guardar
* @throws DataAccessException
*/
public void guardar(T entidad) throws DataAccessException;
/**
* Permite borrar una entidad de manera generica
* @param entidad La entidad a borrar
* @throws DataAccessException
*/
public void borrar(T entidad) throws DataAccessException;
/**
* Refresca el objeto desde la base de datos aplicando bloqueo para update
* @param entity
*/
public void refrescarBloquear(T entity);
/**
* Lista todas las entidades en el repositorio del tipo definido
* @return El listado de instancias
* @throws DataAccessException
*/
public List&amp;lt;T&amp;gt; listar() throws DataAccessException;
}&lt;/code&gt;&lt;/pre&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 400px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.ejemplo.vaadin.dao.hibernate;
import com.ejemplo.vaadin.dao.DaoGenerico;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.ParameterizedType;
import java.util.List;
import org.hibernate.LockMode;
/**
* {@inheritDoc}
*/
public class DaoGenericoImpl&amp;lt;T&amp;gt; implements DaoGenerico&amp;lt;T&amp;gt;
{
protected Class&amp;lt;T&amp;gt; domainClass = extraerClaseDominio();
@Autowired
protected SessionFactory sessionFactory;
/**
* {@inheritDoc}
*/
@SuppressWarnings(&quot;unchecked&quot;)
protected Class&amp;lt;T&amp;gt; extraerClaseDominio()
{
if( domainClass == null )
{
ParameterizedType thisType = ( ParameterizedType ) getClass().getGenericSuperclass();
domainClass = ( Class ) thisType.getActualTypeArguments()[0];
}
return domainClass;
}
/**
* {@inheritDoc}
*/
@Transactional(readOnly = true)
@SuppressWarnings(&quot;unchecked&quot;)
public T getById( int id )
{
return ( T ) sessionFactory.getCurrentSession().get( extraerClaseDominio(), id );
}
/**
* {@inheritDoc}
*/
@Transactional
public void guardar( T entity )
{
sessionFactory.getCurrentSession().saveOrUpdate( entity );
}
/**
* {@inheritDoc}
*/
@Transactional
public void borrar( T entity )
{
sessionFactory.getCurrentSession().delete( entity );
}
/**
* {@inheritDoc}
*/
@Transactional
public void refrescarBloquear( T entity )
{
sessionFactory.getCurrentSession().refresh( entity, LockMode.UPGRADE );
}
/**
* {@inheritDoc}
*/
@Transactional
@SuppressWarnings(&quot;unchecked&quot;)
public List&amp;lt;T&amp;gt; listar()
{
StringBuilder sb = new StringBuilder( &quot;from &quot; );
sb.append( extraerClaseDominio().getName() );
sb.append( &quot; entity&quot; );
return sessionFactory.getCurrentSession().createQuery( sb.toString() ).list();
}
}&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Ahora creo la Entidad Usuario la cual puede ser generada automáticamente con las herramientas provistas por Netbeans la cual le agrega las anotaciones que necesitamos, quedando de la siguiente manera:&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 400px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.ejemplo.vaadin.entidades;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.util.Date;
import java.util.List;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Transient;
/**
* Entidad Usuario que representa la tabla con el mismo nombre en la BD
* @author josorio
*/
@Entity
@Table(name = &quot;usuario&quot;)
public class Usuario implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = &quot;id&quot;)
@GeneratedValue(strategy = GenerationType.AUTO, generator = &quot;gen_usuario&quot;)
@SequenceGenerator(name = &quot;gen_usuario&quot;, sequenceName = &quot;usuario_id_seq&quot;)
private Integer id;
@Basic(optional = false)
@Column(name = &quot;correo&quot;)
private String correo;
@Basic(optional = false)
@Column(name = &quot;clave&quot;)
private String clave;
@Basic(optional = false)
@Column(name = &quot;nombres&quot;)
private String nombres;
@Basic(optional = false)
@Column(name = &quot;apellidos&quot;)
private String apellidos;
@Column(name = &quot;rol&quot;)
private Integer rol;
@Column(name = &quot;fechainactivado&quot;)
@Temporal(TemporalType.TIMESTAMP)
private Date fechainactivado;
@Column(name = &quot;llave_cambio_clave&quot;)
private String llaveCambioClave;
@Column(name = &quot;fecha_creacion&quot;)
@Temporal(TemporalType.TIMESTAMP)
private Date fechaCreacion;
//  @Transient
//  @OneToMany(mappedBy = &quot;usuario&quot;, fetch = FetchType.LAZY)
//  private List&amp;lt;ValesXpedido&amp;gt; valesXpedidoList;
//  @Transient
//  @OneToMany(mappedBy = &quot;usuario1&quot;, fetch = FetchType.LAZY)
//  private List&amp;lt;ValesXpedido&amp;gt; valesXpedidoList1;
@Transient
String nombrecompleto;
public Usuario()
{
}
public Usuario(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCorreo() {
return correo;
}
public void setCorreo(String correo) {
this.correo = correo;
}
public String getClave() {
return clave;
}
public void setClave(String clave) {
this.clave = clave;
}
public String getNombres() {
return nombres;
}
public void setNombres(String nombres) {
this.nombres = nombres;
}
public String getApellidos() {
return apellidos;
}
public void setApellidos(String apellidos) {
this.apellidos = apellidos;
}
public Date getFechainactivado() {
return fechainactivado;
}
public void setFechainactivado(Date fechainactivado) {
this.fechainactivado = fechainactivado;
}
public String getLlaveCambioClave() {
return llaveCambioClave;
}
public void setLlaveCambioClave(String llaveCambioClave) {
this.llaveCambioClave = llaveCambioClave;
}
public Integer getInteger() {
return rol;
}
public void setInteger(Integer rol) {
this.rol = rol;
}
public Date getFechaCreacion() {
return fechaCreacion;
}
public void setFechaCreacion(Date fechaCreacion) {
this.fechaCreacion = fechaCreacion;
}
/**
* Método para asignar al usuario todos los datos del usuario que se entrega como parámetro
* @param usuario
*/
public void copiarDatos(Usuario usuario) {
this.id = usuario.getId();
this.apellidos = usuario.getApellidos();
this.clave = usuario.getClave();
this.correo = usuario.getCorreo();
this.fechainactivado = usuario.getFechainactivado();
this.llaveCambioClave = usuario.getLlaveCambioClave();
this.nombres = usuario.getNombres();
this.rol = usuario.getInteger();
this.fechaCreacion = usuario.getFechaCreacion();
}
public String getNombrecompleto() {
nombrecompleto = nombres+&quot; &quot;+apellidos;
return nombrecompleto;
}
public void setNombrecompleto(String nombrecompleto) {
this.nombrecompleto = nombrecompleto;
}
/**
* Setea en nulo los atributos del objeto. este método se invoca para anular la
* sesión del usuario
*/
public void resetear() {
this.id = -1;
this.rol = null;
this.clave = null;
this.nombres = null;
this.apellidos = null;
this.llaveCambioClave = null;
this.clave = null;
this.correo = null;
}
}&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Ahora creo el DAO para gestionar la entidad Usuarios, el cual va a heredar del DAO genérico que creamos arriba y le añadiremos métodos específicos para administrar la entidad:&lt;/div&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 400px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.ejemplo.vaadin.dao;
import com.ejemplo.vaadin.entidades.Usuario;
import java.util.List;
/**
* (DAO, Objeto de Acceso a Datos)
* DAO para la entidad Usuario
* @author arlex
*/
public interface DaoUsuario extends DaoGenerico&amp;lt;Usuario&amp;gt;
{
/**
* Metodo para obtener los usuarios activos (no eliminados) en la Base de datos
* @return un listado con los objetos Usuario recuperados
*/
public List&amp;lt;Usuario&amp;gt; getActivos();
/**
* Obtiene los usuarios el usuario activo al que corresponde el correo suministrado
* @param correo
* @return El usuario al que corresponde el correo suministrado, o null si no se encuentra
*/
public Usuario getActivoByCorreo( String correo );
}&lt;/code&gt;&lt;/pre&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 400px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.ejemplo.vaadin.dao.hibernate;
/**
*
* @author josorio
*/
import com.ejemplo.vaadin.dao.DaoUsuario;
import com.ejemplo.vaadin.entidades.Usuario;
import java.io.Serializable;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
@Transactional
@Repository
public class DaoUsuarioImpl extends DaoGenericoImpl&amp;lt;Usuario&amp;gt; implements DaoUsuario, Serializable
{
/**
* {@inheritDoc}
*/
public List&amp;lt;Usuario&amp;gt; getActivos()
{
List&amp;lt;Usuario&amp;gt; retorno = null;
try
{
Criteria criteria = sessionFactory.getCurrentSession().createCriteria( Usuario.class );
criteria.add( Restrictions.isNull( &quot;fechainactivado&quot; ) );
criteria.addOrder(Order.asc(&quot;nombres&quot;));
retorno = ( List&amp;lt;Usuario&amp;gt; ) criteria.list();
}
catch( Exception e )
{
e.printStackTrace();
}
return retorno;
}
/**
* {@inheritDoc}
*/
public Usuario getActivoByCorreo( String correo )
{
Usuario retorno = null;
try
{
Criteria criteria = sessionFactory.getCurrentSession().createCriteria( Usuario.class );
criteria.add( Restrictions.eq( &quot;correo&quot;, correo ) );
criteria.add( Restrictions.isNull( &quot;fechainactivado&quot; ) );
retorno = ( Usuario ) criteria.uniqueResult();
}
catch( Exception e )
{
e.printStackTrace();
}
return retorno;
}
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Con esto terminamos la creación de las entidades y los DAO para administrar la información de la base de datos usando hibernate.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Siguiente: &lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-servicios-spring.html&quot;&gt;Controlador&lt;/a&gt;&lt;br /&gt;
Volver al &lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/vaadin-spring-e-hibernate.html&quot;&gt;menú&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;Menú&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/configuracion-inicial.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;Configuración Inicial&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;CRUD - Hibernate - Modelo&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-servicios-spring.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;CRUD - Spring - Controlador&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-vaadin-vista.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;&lt;b&gt;CRUD - Vaadin - Vista&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vaadinspringhibernate.blogspot.com/feeds/2855086301454464379/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo.html#comment-form' title='9 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/2855086301454464379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/2855086301454464379'/><link rel='alternate' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo.html' title='CRUD Ejemplo - Hibernate - Modelo'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3H9A8FJAMM38rvgQPAXxWvlvPItCq5GfUr4pPIBp8yNORBx2x4RzMqSdqDFPfrM_Wjyt-U3URxcXIqMfA4RVphajpjgInz7UdSD2WbDT_bedEWbxKEGehUa1mN0xNevKwnpnE9edGI0D2/s72-c/antesadmneg19.jpeg" height="72" width="72"/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7942628804873074318.post-3984139877646902128</id><published>2011-04-06T07:31:00.000-07:00</published><updated>2015-02-21T11:41:08.225-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="applicationContext"/><category scheme="http://www.blogger.com/atom/ns#" term="autowired"/><category scheme="http://www.blogger.com/atom/ns#" term="GWT"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="properties"/><category scheme="http://www.blogger.com/atom/ns#" term="servlet"/><category scheme="http://www.blogger.com/atom/ns#" term="Vaadin"/><title type='text'>Configuración Inicial</title><content type='html'>&lt;div&gt;
El IDE Netbeans puede ser bajado de forma gratuita de su página oficial http://www.netbeans.com/, en este tutorial suponemos un manejo básico de este IDE.&lt;br /&gt;
&lt;div&gt;
Para empezar a trabajar es necesario agregar un plugin al Netbeans, este proceso se describe claramente en el siguiente link:&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://vaadin.com/netbeans&quot;&gt;http://vaadin.com/netbeans&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
Ahora se crea un nuevo proyecto web añadiendo los frameworsk de Vaadin, Spring e Hibernate.&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ6p7nUn19PlgTokY_HdR3fT1QM4FsjjNoIBD338ibonPt23Z3mZFDWEW6DOJX81YnwBldrx7TgqeRXDMZ4NdxpyZBD6FFT2Y5woB8BHnS5Li8l8Vy7vOFj34jMWQP0diopY39okDcONym/s1600/antesadmneg15.jpeg&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ6p7nUn19PlgTokY_HdR3fT1QM4FsjjNoIBD338ibonPt23Z3mZFDWEW6DOJX81YnwBldrx7TgqeRXDMZ4NdxpyZBD6FFT2Y5woB8BHnS5Li8l8Vy7vOFj34jMWQP0diopY39okDcONym/s320/antesadmneg15.jpeg&quot; id=&quot;BLOGGER_PHOTO_ID_5595455735242336738&quot; style=&quot;cursor: hand; cursor: pointer; display: block; height: 180px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
Se modifican los diferentes archivos xml, como lo son el web.xml y los archivos de configuracion de spring applicationContext.xml y dispatcher-servlet.xml, ademas informacion de conexion con la base de datos para hibernate en un archivo properties.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;web.xml&lt;/b&gt; (Descriptor comun que controla el comportamiento de la web)&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;web-app version=&quot;2.5&quot; xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;&amp;gt;
&amp;lt;context-param&amp;gt;
&amp;lt;param-name&amp;gt;contextConfigLocation&amp;lt;/param-name&amp;gt;
&amp;lt;param-value&amp;gt;/WEB-INF/applicationContext.xml&amp;lt;/param-value&amp;gt;
&amp;lt;/context-param&amp;gt;
&amp;lt;listener&amp;gt;
&amp;lt;listener-class&amp;gt;org.springframework.web.context.ContextLoaderListener&amp;lt;/listener-class&amp;gt;
&amp;lt;/listener&amp;gt;
&amp;lt;servlet&amp;gt;
&amp;lt;servlet-name&amp;gt;dispatcher&amp;lt;/servlet-name&amp;gt;
&amp;lt;servlet-class&amp;gt;org.springframework.web.servlet.DispatcherServlet&amp;lt;/servlet-class&amp;gt;
&amp;lt;load-on-startup&amp;gt;2&amp;lt;/load-on-startup&amp;gt;
&amp;lt;/servlet&amp;gt;
&amp;lt;servlet&amp;gt;
&amp;lt;servlet-name&amp;gt;VaadinApplication&amp;lt;/servlet-name&amp;gt;
&amp;lt;servlet-class&amp;gt;com.ejemplo.vaadin.util.AutowiringApplicationServlet&amp;lt;/servlet-class&amp;gt;
&amp;lt;init-param&amp;gt;
&amp;lt;param-name&amp;gt;application&amp;lt;/param-name&amp;gt;
&amp;lt;param-value&amp;gt;com.ejemplo.vaadin.MyApplication&amp;lt;/param-value&amp;gt;
&amp;lt;/init-param&amp;gt;
&amp;lt;/servlet&amp;gt;
&amp;lt;servlet-mapping&amp;gt;
&amp;lt;servlet-name&amp;gt;dispatcher&amp;lt;/servlet-name&amp;gt;
&amp;lt;url-pattern&amp;gt;/vaadin/html/*&amp;lt;/url-pattern&amp;gt;
&amp;lt;/servlet-mapping&amp;gt;
&amp;lt;servlet-mapping&amp;gt;
&amp;lt;servlet-name&amp;gt;VaadinApplication&amp;lt;/servlet-name&amp;gt;
&amp;lt;url-pattern&amp;gt;/vaadin/*&amp;lt;/url-pattern&amp;gt;
&amp;lt;/servlet-mapping&amp;gt;
&amp;lt;servlet-mapping&amp;gt;
&amp;lt;servlet-name&amp;gt;VaadinApplication&amp;lt;/servlet-name&amp;gt;
&amp;lt;url-pattern&amp;gt;/VAADIN/*&amp;lt;/url-pattern&amp;gt;
&amp;lt;/servlet-mapping&amp;gt;
&amp;lt;session-config&amp;gt;
&amp;lt;session-timeout&amp;gt;
30
&amp;lt;/session-timeout&amp;gt;
&amp;lt;/session-config&amp;gt;
&amp;lt;welcome-file-list&amp;gt;
&amp;lt;welcome-file/&amp;gt;
&amp;lt;/welcome-file-list&amp;gt;
&amp;lt;/web-app&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;applicationContext.xml&lt;/b&gt; (fichero de configuración básico de Spring)&lt;br /&gt;
&lt;br /&gt;
Aca definimos los beans basicos y demas configuraciones necesarias para el proyecto.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xmlns:context=&quot;http://www.springframework.org/schema/context&quot; xmlns:tx=&quot;http://www.springframework.org/schema/tx&quot;
xmlns:p=&quot;http://www.springframework.org/schema/p&quot; xmlns:aop=&quot;http://www.springframework.org/schema/aop&quot;
xmlns:util=&quot;http://www.springframework.org/schema/util&quot;
xmlns:jaxws=&quot;http://cxf.apache.org/jaxws&quot;
xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd&quot;&amp;gt;
&amp;lt;context:property-placeholder location = &quot;classpath:application.properties&quot;/&amp;gt;
&amp;lt;!-- ############ Inicio Hibernate ############ --&amp;gt;
&amp;lt;!-- DATASOURCE DECLARATION --&amp;gt;
&amp;lt;bean id=&quot;dataSource&quot; class=&quot;org.apache.commons.dbcp.BasicDataSource&quot; destroy-method=&quot;close&quot;&amp;gt;
&amp;lt;property name=&quot;driverClassName&quot; value=&quot;${jdbc.driverClassName}&quot; /&amp;gt;
&amp;lt;property name=&quot;url&quot; value=&quot;${jdbc.url}&quot; /&amp;gt;
&amp;lt;property name=&quot;username&quot; value=&quot;${jdbc.username}&quot; /&amp;gt;
&amp;lt;property name=&quot;password&quot; value=&quot;${jdbc.password}&quot; /&amp;gt;
&amp;lt;/bean&amp;gt;
&amp;lt;!-- HIBERNATE SESSION FACTORY --&amp;gt;
&amp;lt;bean id=&quot;sessionFactory&quot; class=&quot;org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean&quot;&amp;gt;
&amp;lt;property name=&quot;dataSource&quot; ref=&quot;dataSource&quot; /&amp;gt;
&amp;lt;property name=&quot;hibernateProperties&quot;&amp;gt;
&amp;lt;props&amp;gt;
&amp;lt;prop key=&quot;hibernate.dialect&quot;&amp;gt;${hibernate.dialect}&amp;lt;/prop&amp;gt;
&amp;lt;prop key=&quot;hibernate.show_sql&quot;&amp;gt;${hibernate.show_sql}&amp;lt;/prop&amp;gt;
&amp;lt;prop key=&quot;hibernate.generate_statistics&quot;&amp;gt;${hibernate.generate_statistics}&amp;lt;/prop&amp;gt;
&amp;lt;/props&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;property name=&quot;annotatedClasses&quot;&amp;gt;
&amp;lt;list&amp;gt;
&amp;lt;value&amp;gt;com.ejemplo.vaadin.entidades.Usuario&amp;lt;/value&amp;gt;
&amp;lt;/list&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;property name=&quot;eventListeners&quot;&amp;gt;
&amp;lt;map&amp;gt;
&amp;lt;entry key=&quot;merge&quot;&amp;gt;
&amp;lt;bean class=&quot;org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener&quot;/&amp;gt;
&amp;lt;/entry&amp;gt;
&amp;lt;/map&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;
&amp;lt;!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) --&amp;gt;
&amp;lt;bean id=&quot;transactionManager&quot; class=&quot;org.springframework.orm.hibernate3.HibernateTransactionManager&quot;
p:sessionFactory-ref=&quot;sessionFactory&quot;/&amp;gt;
&amp;lt;!-- ############ Fin Hibernate ############ --&amp;gt;
&amp;lt;context:annotation-config /&amp;gt;
&amp;lt;tx:annotation-driven/&amp;gt;
&amp;lt;aop:aspectj-autoproxy/&amp;gt;
&amp;lt;!-- Scan por los DAO --&amp;gt;
&amp;lt;context:component-scan base-package=&quot;com.ejemplo.vaadin.dao&quot;/&amp;gt;
&amp;lt;!-- Declaramos los servicios explicitamente para poder referenciarlos--&amp;gt;
&amp;lt;bean class=&quot;com.ejemplo.vaadin.servicios.impl.ServicioUsuariosImpl&quot; id=&quot;servicioUsuarios&quot;/&amp;gt;
&amp;lt;/beans&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;b&gt;dispatcher-servlet.xml &lt;/b&gt;(Archivo de configuracion de spring)&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xmlns:p=&quot;http://www.springframework.org/schema/p&quot;
xmlns:aop=&quot;http://www.springframework.org/schema/aop&quot;
xmlns:tx=&quot;http://www.springframework.org/schema/tx&quot;
xmlns:context=&quot;http://www.springframework.org/schema/context&quot;
xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd&quot;&amp;gt;
&amp;lt;context:annotation-config /&amp;gt;
&amp;lt;context:component-scan base-package=&quot;com.ejemplo.vaadin.rest&quot;/&amp;gt;
&amp;lt;bean id=&quot;contentNegotiatingViewResolver&quot;
class=&quot;org.springframework.web.servlet.view.ContentNegotiatingViewResolver&quot;&amp;gt;
&amp;lt;property name=&quot;favorPathExtension&quot; value=&quot;true&quot; /&amp;gt;
&amp;lt;property name=&quot;favorParameter&quot; value=&quot;true&quot; /&amp;gt;
&amp;lt;!--
default media format parameter name is &#39;format&#39;
--&amp;gt;
&amp;lt;property name=&quot;ignoreAcceptHeader&quot; value=&quot;false&quot; /&amp;gt;
&amp;lt;property name=&quot;order&quot; value=&quot;1&quot; /&amp;gt;
&amp;lt;property name=&quot;mediaTypes&quot;&amp;gt;
&amp;lt;map&amp;gt;
&amp;lt;entry key=&quot;html&quot; value=&quot;text/html&quot;/&amp;gt;
&amp;lt;entry key=&quot;json&quot; value=&quot;application/json&quot; /&amp;gt;
&amp;lt;entry key=&quot;xml&quot; value=&quot;application/xml&quot; /&amp;gt;
&amp;lt;/map&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;property name=&quot;viewResolvers&quot;&amp;gt;
&amp;lt;list&amp;gt;
&amp;lt;bean class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;&amp;gt;
&amp;lt;property name=&quot;prefix&quot; value=&quot;/WEB-INF/jsp/&quot;/&amp;gt;
&amp;lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot;/&amp;gt;
&amp;lt;property name=&quot;viewClass&quot; value=&quot;org.springframework.web.servlet.view.JstlView&quot; /&amp;gt;
&amp;lt;/bean&amp;gt;
&amp;lt;/list&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;property name=&quot;defaultViews&quot;&amp;gt;
&amp;lt;list&amp;gt;
&amp;lt;bean class=&quot;org.springframework.web.servlet.view.json.MappingJacksonJsonView&quot; /&amp;gt;
&amp;lt;bean class=&quot;org.springframework.web.servlet.view.xml.MarshallingView&quot;&amp;gt;
&amp;lt;constructor-arg&amp;gt;
&amp;lt;bean class=&quot;org.springframework.oxm.xstream.XStreamMarshaller&quot; /&amp;gt;
&amp;lt;/constructor-arg&amp;gt;
&amp;lt;/bean&amp;gt;
&amp;lt;/list&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;
&amp;lt;!-- Configure the multipart resolver --&amp;gt;
&amp;lt;bean id=&quot;multipartResolver&quot; class=&quot;org.springframework.web.multipart.commons.CommonsMultipartResolver&quot;&amp;gt;
&amp;lt;!-- the maximum file size in bytes --&amp;gt;
&amp;lt;property name=&quot;maxUploadSize&quot; value=&quot;20000000&quot;/&amp;gt;
&amp;lt;/bean&amp;gt;

&amp;lt;/beans&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;application.properties&lt;/b&gt;Almacena los parámetros configurables de una aplicación. También se puede utilizar para el almacenamiento de cadenas para la internacionalización y localización (i18n)&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; ################ BD ############################
## ESPECIFICOS DE LA BD
## BD DESARROLLO ###############################
jdbc.driverClassName=org.postgresql.Driver
## SERVIDOR BD
jdbc.url=jdbc:postgresql://localhost:5432/ejemplo
jdbc.username=usuario
jdbc.password=contrasena
#
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
############################################################
## FIN SERVIDOR BD
## HIBERNATE SETTINGS
hibernate.generate_statistics=true
hibernate.show_sql=false
hibernate.hbm2ddl.auto=false
########################################################&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Se crea servlet para trabajar con Vaadin y con Spring convinados&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Servlet necesario para trabajar con Spring y Vaadin relacionados, se define en el web.xml, permite la inyeccion de los beans definidos en el applicationContext.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 400px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.ejemplo.vaadin.util;
import com.vaadin.Application;
import com.vaadin.terminal.gwt.server.ApplicationServlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
//import org.apache.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
/**
* {@link ApplicationServlet} that autowires and configures the {@link Application}
* objects it creates using the containing Spring {@link WebApplicationContext}.
*
* &amp;lt;p&amp;gt;
* When using this servlet, annotations such as
* &amp;lt;code&amp;gt;@{@link org.springframework.beans.factory.annotation.Autowired Autowired}&amp;lt;/code&amp;gt;
* and &amp;lt;code&amp;gt;@{@link org.springframework.beans.factory.annotation.Required Required}&amp;lt;/code&amp;gt;
* and interfaces such as {@link org.springframework.beans.factory.BeanFactoryAware BeanFactoryAware},
* etc. will work on your {@link Application} instances.
* &amp;lt;/p&amp;gt;
*
* &amp;lt;p&amp;gt;
* An example:
* &amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;
* &amp;amp;lt;bean id=&quot;applicationServlet&quot; class=&quot;org.springframework.web.servlet.mvc.ServletWrappingController&quot;
*   p:servletClass=&quot;com.example.AutowiringApplicationServlet&quot;&amp;amp;gt;
*   &amp;amp;lt;property name=&quot;initParameters&quot;&amp;amp;gt;
*     &amp;amp;lt;props&amp;amp;gt;
*       &amp;amp;lt;prop key=&quot;application&quot;&amp;amp;gt;some.spring.configured.Application&amp;amp;lt;/prop&amp;amp;gt;
*       &amp;amp;lt;prop key=&quot;productionMode&quot;&amp;amp;gt;true&amp;amp;lt;/prop&amp;amp;gt;
*     &amp;amp;lt;/props&amp;amp;gt;
*   &amp;amp;lt;/property&amp;amp;gt;
* &amp;amp;lt;/bean&amp;amp;gt;
* &amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;
*
* @see org.springframework.web.servlet.mvc.ServletWrappingController
* @see AutowireCapableBeanFactory
*/
public class AutowiringApplicationServlet extends ApplicationServlet {
//  protected final Logger log = Logger.getLogger(getClass());
private WebApplicationContext webApplicationContext;
/**
* Initialize this servlet.
*
* @throws ServletException if there is no {@link WebApplicationContext} associated with this servlet&#39;s context
*/
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
//    log.debug(&quot;finding containing WebApplicationContext&quot;);
System.out.println(&quot;finding containing WebApplicationContext&quot;);
try {
this.webApplicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(config.getServletContext());
} catch (IllegalStateException e) {
throw new ServletException(&quot;could not locate containing WebApplicationContext&quot;);
}
}
/**
* Get the containing Spring {@link WebApplicationContext}.
* This only works after the servlet has been initialized (via {@link #init init()}).
*
* @throws ServletException if the operation fails
*/
protected final WebApplicationContext getWebApplicationContext() throws ServletException {
if (this.webApplicationContext == null) {
throw new ServletException(&quot;can&#39;t retrieve WebApplicationContext before init() is invoked&quot;);
}
return this.webApplicationContext;
}
/**
* Get the {@link AutowireCapableBeanFactory} associated with the containing Spring {@link WebApplicationContext}.
* This only works after the servlet has been initialized (via {@link #init init()}).
*
* @throws ServletException if the operation fails
*/
protected final AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws ServletException {
try {
return getWebApplicationContext().getAutowireCapableBeanFactory();
} catch (IllegalStateException e) {
throw new ServletException(&quot;containing context &quot; + getWebApplicationContext() + &quot; is not autowire-capable&quot;, e);
}
}
/**
* Create and configure a new instance of the configured application class.
*
* &amp;lt;p&amp;gt;
* The implementation in {@link AutowiringApplicationServlet} delegates to
* {@link #getAutowireCapableBeanFactory getAutowireCapableBeanFactory()}, then invokes
* {@link AutowireCapableBeanFactory#createBean AutowireCapableBeanFactory.createBean()}
* using the configured {@link Application} class.
* &amp;lt;/p&amp;gt;
*
* @param request the triggering {@link HttpServletRequest}
* @throws ServletException if creation or autowiring fails
*/
@Override
protected Application getNewApplication(HttpServletRequest request) throws ServletException {
Class&amp;lt;? extends Application&amp;gt; cl = null;
try {
cl = getApplicationClass();
} catch (ClassNotFoundException e) {
//      log.error( &quot;failed to find the application class&quot; );
System.out.println(&quot;failed to find the application class&quot;);
}
//    log.debug(&quot;creating new instance of &quot; + cl);
System.out.println(&quot;creating new instance of &quot; + cl);
AutowireCapableBeanFactory beanFactory = getAutowireCapableBeanFactory();
try {
return beanFactory.createBean(cl);
} catch (BeansException e) {
throw new ServletException(&quot;failed to create new instance of &quot; + cl, e);
}
}
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Si desean compilar el proyecto usando maven este seria el pom.xml:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); height: 400px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;word-wrap: normal;&quot;&gt;&lt;project style=&quot;color: black; font-family: arial; font-size: 12px; line-height: 20px;&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xsi:schemalocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;&lt;dependencies&gt;&lt;dependency&gt;  &lt;/dependency&gt;&lt;/dependencies&gt;
&lt;/project&gt;&lt;span style=&quot;font-size: 12px; line-height: 20px;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&amp;gt;
    &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;

    &amp;lt;groupId&amp;gt;com.ejemplo.vaadin&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;EjemploVaadin&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;
    &amp;lt;packaging&amp;gt;war&amp;lt;/packaging&amp;gt;

    &amp;lt;name&amp;gt;EjemploVaadin&amp;lt;/name&amp;gt;

    &amp;lt;properties&amp;gt;
        &amp;lt;vaadin.version&amp;gt;6.8.15&amp;lt;/vaadin.version&amp;gt;
        &amp;lt;gwt.version&amp;gt;2.7.0&amp;lt;/gwt.version&amp;gt;
        &amp;lt;gwt.plugin.version&amp;gt;2.2.0&amp;lt;/gwt.plugin.version&amp;gt;
        &amp;lt;spring.version&amp;gt;3.0.5.RELEASE&amp;lt;/spring.version&amp;gt;
        &amp;lt;version.hibernate&amp;gt;3.5.3-Final&amp;lt;/version.hibernate&amp;gt;
        &amp;lt;version.slf4j&amp;gt;1.5.8&amp;lt;/version.slf4j&amp;gt;
        &amp;lt;version.log4j&amp;gt;1.2.14&amp;lt;/version.log4j&amp;gt;
        &amp;lt;endorsed.dir&amp;gt;${project.build.directory}/endorsed&amp;lt;/endorsed.dir&amp;gt;
        &amp;lt;project.build.sourceEncoding&amp;gt;UTF-8&amp;lt;/project.build.sourceEncoding&amp;gt;
        &amp;lt;project.reporting.outputEncoding&amp;gt;UTF-8&amp;lt;/project.reporting.outputEncoding&amp;gt;
    &amp;lt;/properties&amp;gt;
    
    &amp;lt;dependencies&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;com.vaadin&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;vaadin&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${vaadin.version}&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;com.google.gwt&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;gwt-user&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${gwt.version}&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
        
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;javax&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;javaee-web-api&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;7.0&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
        
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;spring-core&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${spring.version}&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;spring-context&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${spring.version}&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;spring-web&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${spring.version}&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;spring-webmvc&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${spring.version}&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;spring-orm&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${spring.version}&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;spring-context-support&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${spring.version}&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;spring-tx&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${spring.version}&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;spring-oxm&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${spring.version}&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;com.thoughtworks.xstream&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;xstream&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.3.1&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        
        &amp;lt;dependency&amp;gt;
                &amp;lt;groupId&amp;gt;commons-fileupload&amp;lt;/groupId&amp;gt;
                &amp;lt;artifactId&amp;gt;commons-fileupload&amp;lt;/artifactId&amp;gt;
                &amp;lt;version&amp;gt;1.2&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;

        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;javax.mail&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;mail&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.4&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.hibernate&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;hibernate-core&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${version.hibernate}&amp;lt;/version&amp;gt;
            &amp;lt;exclusions&amp;gt;
                &amp;lt;exclusion&amp;gt;
                    &amp;lt;groupId&amp;gt;org.slf4j&amp;lt;/groupId&amp;gt;
                    &amp;lt;artifactId&amp;gt;slf4j-api&amp;lt;/artifactId&amp;gt;
                &amp;lt;/exclusion&amp;gt;
            &amp;lt;/exclusions&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.hibernate&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;hibernate-annotations&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${version.hibernate}&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.hibernate&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;hibernate-validator&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;4.0.2.GA&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;

        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.aspectj&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;aspectjweaver&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.6.8&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;runtime&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;javassist&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;javassist&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;3.4.GA&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.slf4j&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;slf4j-log4j12&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${version.slf4j}&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.slf4j&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;slf4j-api&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${version.slf4j}&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;log4j&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;log4j&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${version.log4j}&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;commons-logging&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;commons-logging&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.1.1&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;compile&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;commons-dbcp&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;commons-dbcp&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.4&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;artifactId&amp;gt;commons-collections&amp;lt;/artifactId&amp;gt;
            &amp;lt;groupId&amp;gt;commons-collections&amp;lt;/groupId&amp;gt;
            &amp;lt;version&amp;gt;3.1&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;mysql&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;mysql-connector-java&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;5.1.16&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.hsqldb&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;hsqldb&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;2.0.0&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;javax.persistence&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;persistence-api&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;javax.servlet&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;servlet-api&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;2.5&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;taglibs&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;standard&amp;lt;/artifactId&amp;gt;
            &amp;lt;scope&amp;gt;runtime&amp;lt;/scope&amp;gt;
            &amp;lt;version&amp;gt;1.1.1&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;taglibs&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;c&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.1.1&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;runtime&amp;lt;/scope&amp;gt;
            &amp;lt;type&amp;gt;tld&amp;lt;/type&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;taglibs&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;fmt&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.1.1&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;runtime&amp;lt;/scope&amp;gt;
            &amp;lt;type&amp;gt;tld&amp;lt;/type&amp;gt;
        &amp;lt;/dependency&amp;gt;
        
        
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;javax.validation&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;validation-api&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.0.0.GA&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;javax.validation&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;validation-api&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.0.0.GA&amp;lt;/version&amp;gt;
            &amp;lt;classifier&amp;gt;sources&amp;lt;/classifier&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.eclipse.persistence&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;eclipselink&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;2.2.0&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.eclipse.persistence&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;javax.persistence&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;2.0.3&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.eclipse.persistence&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;org.eclipse.persistence.jpa.modelgen.processor&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;2.2.0&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;javax.annotation&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;jsr250-api&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;javax.servlet&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;jstl&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.2&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.codehaus.jackson&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;jackson-mapper-asl&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.8.1&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;junit&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;junit&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;4.8.1&amp;lt;/version&amp;gt;
            &amp;lt;type&amp;gt;jar&amp;lt;/type&amp;gt;
            &amp;lt;scope&amp;gt;compile&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
        
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;commons-digester&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;commons-digester&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.7&amp;lt;/version&amp;gt;
            &amp;lt;type&amp;gt;jar&amp;lt;/type&amp;gt;
            &amp;lt;scope&amp;gt;compile&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
        
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;postgresql&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;postgresql&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;8.4-702.jdbc4&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
    &amp;lt;/dependencies&amp;gt;

    &amp;lt;build&amp;gt;
        &amp;lt;plugins&amp;gt;
            &amp;lt;plugin&amp;gt;
                &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;
                &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;
                &amp;lt;version&amp;gt;2.3.2&amp;lt;/version&amp;gt;
                &amp;lt;configuration&amp;gt;
                    &amp;lt;source&amp;gt;1.6&amp;lt;/source&amp;gt;
                    &amp;lt;target&amp;gt;1.6&amp;lt;/target&amp;gt;
                &amp;lt;/configuration&amp;gt;
            &amp;lt;/plugin&amp;gt;

            &amp;lt;!-- Compile custom GWT components or widget dependencies with the GWT compiler --&amp;gt;
            &amp;lt;!-- 
            &amp;lt;plugin&amp;gt;
                &amp;lt;groupId&amp;gt;org.codehaus.mojo&amp;lt;/groupId&amp;gt;
                &amp;lt;artifactId&amp;gt;gwt-maven-plugin&amp;lt;/artifactId&amp;gt;
                &amp;lt;version&amp;gt;${gwt.plugin.version}&amp;lt;/version&amp;gt;
                &amp;lt;configuration&amp;gt;
                    &amp;lt;modules&amp;gt;
                        &amp;lt;module&amp;gt;com.ejemplo.vaadin.widgetset.Widgetset&amp;lt;/module&amp;gt;
                    &amp;lt;/modules&amp;gt;
                    &amp;lt;webappDirectory&amp;gt;src/main/webapp/VAADIN/widgetsets&amp;lt;/webappDirectory&amp;gt;
                    &amp;lt;extraJvmArgs&amp;gt;-Xmx512M -Xss1024k&amp;lt;/extraJvmArgs&amp;gt;
                    &amp;lt;runTarget&amp;gt;DrDental&amp;lt;/runTarget&amp;gt;
                    &amp;lt;hostedWebapp&amp;gt;${project.build.directory}/${project.build.finalName}&amp;lt;/hostedWebapp&amp;gt;
                    &amp;lt;noServer&amp;gt;true&amp;lt;/noServer&amp;gt;
                    &amp;lt;port&amp;gt;8080&amp;lt;/port&amp;gt;
                    &amp;lt;compileReport&amp;gt;false&amp;lt;/compileReport&amp;gt;
                &amp;lt;/configuration&amp;gt;
                &amp;lt;executions&amp;gt;
                    &amp;lt;execution&amp;gt;
                        &amp;lt;goals&amp;gt;
                            &amp;lt;goal&amp;gt;resources&amp;lt;/goal&amp;gt;
                            &amp;lt;goal&amp;gt;compile&amp;lt;/goal&amp;gt;
                        &amp;lt;/goals&amp;gt;
                    &amp;lt;/execution&amp;gt;
                &amp;lt;/executions&amp;gt;
                &amp;lt;dependencies&amp;gt;
                    &amp;lt;dependency&amp;gt;
                        &amp;lt;groupId&amp;gt;com.google.gwt&amp;lt;/groupId&amp;gt;
                        &amp;lt;artifactId&amp;gt;gwt-user&amp;lt;/artifactId&amp;gt;
                        &amp;lt;version&amp;gt;2.3.0&amp;lt;/version&amp;gt;
                    &amp;lt;/dependency&amp;gt;
                    &amp;lt;dependency&amp;gt;
                        &amp;lt;groupId&amp;gt;com.google.gwt&amp;lt;/groupId&amp;gt;
                        &amp;lt;artifactId&amp;gt;gwt-dev&amp;lt;/artifactId&amp;gt;
                        &amp;lt;version&amp;gt;2.3.0&amp;lt;/version&amp;gt;
                    &amp;lt;/dependency&amp;gt;
                &amp;lt;/dependencies&amp;gt;
            &amp;lt;/plugin&amp;gt;
            
            &amp;lt;plugin&amp;gt;
                &amp;lt;groupId&amp;gt;com.vaadin&amp;lt;/groupId&amp;gt;
                &amp;lt;artifactId&amp;gt;vaadin-maven-plugin&amp;lt;/artifactId&amp;gt;
                &amp;lt;version&amp;gt;1.0.2&amp;lt;/version&amp;gt;
                &amp;lt;configuration&amp;gt;
                    &amp;lt;module&amp;gt;com.ejemplo.vaadin.widgetset.Widgetset&amp;lt;/module&amp;gt;
                &amp;lt;/configuration&amp;gt;
                &amp;lt;executions&amp;gt;
                    &amp;lt;execution&amp;gt;
                        &amp;lt;goals&amp;gt;
                            &amp;lt;goal&amp;gt;update-widgetset&amp;lt;/goal&amp;gt;
                        &amp;lt;/goals&amp;gt;
                    &amp;lt;/execution&amp;gt;
                &amp;lt;/executions&amp;gt;
            &amp;lt;/plugin&amp;gt;
                  --&amp;gt;

            &amp;lt;!-- A simple Jetty test server at http://localhost:8080/DrDental can be launched with the Maven goal jetty:run
        and stopped with jetty:stop --&amp;gt;
            &amp;lt;plugin&amp;gt;
                &amp;lt;groupId&amp;gt;org.mortbay.jetty&amp;lt;/groupId&amp;gt;
                &amp;lt;artifactId&amp;gt;maven-jetty-plugin&amp;lt;/artifactId&amp;gt;
                &amp;lt;version&amp;gt;6.1.24&amp;lt;/version&amp;gt;
                &amp;lt;configuration&amp;gt;
                    &amp;lt;stopPort&amp;gt;9966&amp;lt;/stopPort&amp;gt;
                    &amp;lt;stopKey&amp;gt;Vaadin&amp;lt;/stopKey&amp;gt;
                    &amp;lt;!-- Redeploy every x seconds if changes are detected, 0 for no automatic redeployment --&amp;gt;
                    &amp;lt;scanIntervalSeconds&amp;gt;0&amp;lt;/scanIntervalSeconds&amp;gt;
                    &amp;lt;!-- make sure Jetty also finds the widgetset --&amp;gt;
                    &amp;lt;webAppConfig&amp;gt;
                        &amp;lt;contextPath&amp;gt;/vaadin&amp;lt;/contextPath&amp;gt;
                        &amp;lt;baseResource implementation=&quot;org.mortbay.resource.ResourceCollection&quot;&amp;gt;
                            &amp;lt;!-- Workaround for Maven/Jetty issue http://jira.codehaus.org/browse/JETTY-680 --&amp;gt;
                            &amp;lt;!-- &amp;lt;resources&amp;gt;src/main/webapp,${project.build.directory}/${project.build.finalName}&amp;lt;/resources&amp;gt; --&amp;gt;
                            &amp;lt;resourcesAsCSV&amp;gt;src/main/webapp,${project.build.directory}/${project.build.finalName}
                            &amp;lt;/resourcesAsCSV&amp;gt;
                        &amp;lt;/baseResource&amp;gt;
                    &amp;lt;/webAppConfig&amp;gt;
                &amp;lt;/configuration&amp;gt;
            &amp;lt;/plugin&amp;gt;
        &amp;lt;/plugins&amp;gt;
        &amp;lt;finalName&amp;gt;vaadin&amp;lt;/finalName&amp;gt;
    &amp;lt;/build&amp;gt;
    
    &amp;lt;repositories&amp;gt;
        &amp;lt;repository&amp;gt;
            &amp;lt;id&amp;gt;vaadin-snapshots&amp;lt;/id&amp;gt;
            &amp;lt;url&amp;gt;http://oss.sonatype.org/content/repositories/vaadin-snapshots/&amp;lt;/url&amp;gt;
            &amp;lt;releases&amp;gt;
                &amp;lt;enabled&amp;gt;false&amp;lt;/enabled&amp;gt;
            &amp;lt;/releases&amp;gt;
            &amp;lt;snapshots&amp;gt;
                &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;
            &amp;lt;/snapshots&amp;gt;
        &amp;lt;/repository&amp;gt;        
        &amp;lt;repository&amp;gt;
            &amp;lt;id&amp;gt;vaadin-addons&amp;lt;/id&amp;gt;
            &amp;lt;url&amp;gt;http://maven.vaadin.com/vaadin-addons&amp;lt;/url&amp;gt;
        &amp;lt;/repository&amp;gt;
        &amp;lt;!--repository&amp;gt;
            &amp;lt;url&amp;gt;http://ftp.ing.umu.se/mirror/eclipse/rt/eclipselink/maven.repo&amp;lt;/url&amp;gt;
            &amp;lt;id&amp;gt;eclipselink&amp;lt;/id&amp;gt;
            &amp;lt;layout&amp;gt;default&amp;lt;/layout&amp;gt;
            &amp;lt;name&amp;gt;Repository for library Library[eclipselink]&amp;lt;/name&amp;gt;
        &amp;lt;/repository--&amp;gt;
        &amp;lt;!--repository&amp;gt;
         &amp;lt;id&amp;gt;EclipseLink Repo&amp;lt;/id&amp;gt;
         &amp;lt;url&amp;gt;http://www.eclipse.org/downloads/download.php?r=1&amp;amp;amp;nf=1&amp;amp;amp;file=/rt/eclipselink/maven.repo&amp;lt;/url&amp;gt;
         --&amp;gt;&amp;lt;!-- use this for javax.persistence--&amp;gt;
         &amp;lt;!--snapshots&amp;gt;
            &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;
         &amp;lt;/snapshots&amp;gt; --&amp;gt;
      &amp;lt;!--/repository--&amp;gt;
    &amp;lt;/repositories&amp;gt;
    
    &amp;lt;pluginRepositories&amp;gt;
        &amp;lt;pluginRepository&amp;gt;
            &amp;lt;id&amp;gt;codehaus-snapshots&amp;lt;/id&amp;gt;
            &amp;lt;url&amp;gt;http://nexus.codehaus.org/snapshots&amp;lt;/url&amp;gt;
            &amp;lt;snapshots&amp;gt;
                &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;
            &amp;lt;/snapshots&amp;gt;
            &amp;lt;releases&amp;gt;
                &amp;lt;enabled&amp;gt;false&amp;lt;/enabled&amp;gt;
            &amp;lt;/releases&amp;gt;
        &amp;lt;/pluginRepository&amp;gt;
        &amp;lt;pluginRepository&amp;gt;
            &amp;lt;id&amp;gt;vaadin-snapshots&amp;lt;/id&amp;gt;
            &amp;lt;url&amp;gt;http://oss.sonatype.org/content/repositories/vaadin-snapshots/&amp;lt;/url&amp;gt;
            &amp;lt;snapshots&amp;gt;
                &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;
            &amp;lt;/snapshots&amp;gt;
            &amp;lt;releases&amp;gt;
                &amp;lt;enabled&amp;gt;false&amp;lt;/enabled&amp;gt;
            &amp;lt;/releases&amp;gt;
        &amp;lt;/pluginRepository&amp;gt;
    &amp;lt;/pluginRepositories&amp;gt;

&amp;lt;/project&amp;gt;
&lt;/span&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 20px;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Siguiente: &lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo.html&quot;&gt;Modelo&lt;/a&gt;&lt;br /&gt;
Volver al &lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/vaadin-spring-e-hibernate.html&quot;&gt;menú&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;Menú&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/configuracion-inicial.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;Configuración Inicial&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;CRUD - Hibernate - Modelo&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-servicios-spring.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;CRUD - Spring - Controlador&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-vaadin-vista.html&quot; style=&quot;color: #29aae1; text-decoration: none;&quot;&gt;&lt;b&gt;CRUD - Vaadin - Vista&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vaadinspringhibernate.blogspot.com/feeds/3984139877646902128/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2011/04/configuracion-inicial.html#comment-form' title='7 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/3984139877646902128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/3984139877646902128'/><link rel='alternate' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2011/04/configuracion-inicial.html' title='Configuración Inicial'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ6p7nUn19PlgTokY_HdR3fT1QM4FsjjNoIBD338ibonPt23Z3mZFDWEW6DOJX81YnwBldrx7TgqeRXDMZ4NdxpyZBD6FFT2Y5woB8BHnS5Li8l8Vy7vOFj34jMWQP0diopY39okDcONym/s72-c/antesadmneg15.jpeg" height="72" width="72"/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7942628804873074318.post-8166879460962920787</id><published>2011-04-05T15:22:00.000-07:00</published><updated>2015-03-25T18:03:06.449-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="integración"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><category scheme="http://www.blogger.com/atom/ns#" term="Vaadin"/><title type='text'>Vaadin Spring e Hibernate</title><content type='html'>&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Introducción&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Vaadin:&lt;/b&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;es un framework para aplicaciones web de &lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=es&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.es&amp;amp;u=http://en.wikipedia.org/wiki/Open_source&amp;amp;usg=ALkJrhiEtUN08jI-jFrqGYxrEaPLKNrVCg&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;código abierto&lt;/a&gt;. En contraste con las bibliotecas JavaScript y un plug-in de navegador que ofrece soluciones basadas en una arquitectura de servidor, lo que significa que la mayoría de la lógica se ejecuta en los servidores. La tecnología Ajax se utiliza en el lado del navegador para asegurar una experiencia de usuario rica e interactiva. Vaadin esta pensado para trabajar sin preocuparnos de estar en el lado del cliente o del servidor y se puede extender usando &lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=es&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.es&amp;amp;u=http://en.wikipedia.org/wiki/Google_Web_Toolkit&amp;amp;usg=ALkJrhhRja7C_9GTk2fcTlqP5zzk_mc3bw&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;Google Web Toolkit&lt;/a&gt; (GWT). (Wikipedia).&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;Se puede obtener &lt;/span&gt;&lt;/li&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;información&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt; adicional en la página oficial, además se cuenta con tutoriales y códigos de ejemplo. &lt;/span&gt;&lt;a href=&quot;http://vaadin.com/tutorial&quot;&gt;http://vaadin.com/tutorial&lt;/a&gt;, &lt;a href=&quot;http://demo.vaadin.com/sampler/&quot;&gt;http://demo.vaadin.com/sampler/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;El &lt;b&gt;Spring Framework&lt;/b&gt; (también conocido simplemente como &lt;b&gt;Spring&lt;/b&gt;) es un &lt;a href=&quot;http://es.wikipedia.org/wiki/Framework&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;framework&lt;/a&gt; de &lt;a href=&quot;http://es.wikipedia.org/wiki/C%C3%B3digo_abierto&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;código abierto&lt;/a&gt; de desarrollo de aplicaciones para la &lt;a href=&quot;http://es.wikipedia.org/wiki/Plataforma_Java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;plataforma Java&lt;/a&gt;. La primera versión fue escrita por Rod Jonhson, quien lo lanzó primero con la publicación de su libro &lt;i&gt;Expert One-on-One Java EE Design and Development&lt;/i&gt; (Wrox Press, octubre 2002). También hay una versión para la plataforma &lt;a class=&quot;mw-redirect&quot; href=&quot;http://es.wikipedia.org/wiki/.NET&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;.NET&quot;&gt;.NET&lt;/a&gt;, Spring .NET . (Wikipedia). &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;a href=&quot;http://www.springsource.org/&quot;&gt;http://www.springsource.org/&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;a href=&quot;http://www.springsource.org/&quot;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;b&gt;Hibernate&lt;/b&gt; es una herramienta de &lt;a href=&quot;http://es.wikipedia.org/wiki/Mapeo_objeto-relacional&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;Mapeo objeto-relacional&lt;/a&gt; (ORM) para la &lt;a href=&quot;http://es.wikipedia.org/wiki/Plataforma_Java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;plataforma Java&lt;/a&gt; (y disponible también para &lt;a class=&quot;mw-redirect&quot; href=&quot;http://es.wikipedia.org/wiki/.Net&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;.Net&quot;&gt;.Net&lt;/a&gt; con el nombre de &lt;a href=&quot;http://es.wikipedia.org/wiki/NHibernate&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;NHibernate&lt;/a&gt;) que facilita el mapeo de atributos entre una &lt;a href=&quot;http://es.wikipedia.org/wiki/Base_de_datos&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;base de datos&lt;/a&gt; relacional tradicional y el modelo de &lt;a class=&quot;mw-redirect&quot; href=&quot;http://es.wikipedia.org/wiki/Objetos_(programaci%C3%B3n_orientada_a_objetos)&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Objetos (programación orientada a objetos)&quot;&gt;objetos&lt;/a&gt; de una aplicación, mediante archivos declarativos (&lt;a class=&quot;mw-redirect&quot; href=&quot;http://es.wikipedia.org/wiki/XML&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;XML&quot;&gt;XML&lt;/a&gt;) o anotaciones en los beans de las entidades que permiten establecer estas relaciones. Hibernate es &lt;a href=&quot;http://es.wikipedia.org/wiki/Software_libre&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;software libre&lt;/a&gt;, distribuido bajo los términos de la licencia &lt;a class=&quot;mw-redirect&quot; href=&quot;http://es.wikipedia.org/wiki/GNU_LGPL&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;GNU LGPL&quot;&gt;GNU LGPL&lt;/a&gt;. (Wikipedia). &lt;a href=&quot;http://www.hibernate.org/&quot;&gt;http://www.hibernate.org/&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Contenido&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;La idea de este blog es mostrar como integrar estas tres tecnologías de desarrollo para construir aplicaciones web ricas basadas en java, no se entrará en mucho detalle en ninguno de los frameworks arriba mencionados, se supondrá que ya se tienen bases de programación en lenguaje JAVA y en el uso de los frameworks Spring, Hibernate y Vaadin (de ser necesario pueden consultar las páginas oficiales de cada uno).&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Se trabajará con el IDE Netbeans 6.9.1 para efectos de desarrollo.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En los siguientes posts ire describiendo el proceso de integración de estos tres frameworks. &lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Menú&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/configuracion-inicial.html&quot;&gt;Configuración Inicial&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo.html&quot;&gt;CRUD - Hibernate - Modelo&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-servicios-spring.html&quot;&gt;CRUD - Spring - Controlador&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://vaadinspringhibernate.blogspot.com/2011/04/crud-ejemplo-vaadin-vista.html&quot;&gt;CRUD - Vaadin - Vista&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: #1c1c1c; color: #cccccc; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.8500003814697px; line-height: 18px;&quot;&gt;
&lt;span style=&quot;font-size: 13px;&quot;&gt;El código del proyecto lo pueden encontrar en github construido con maven&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #1c1c1c; color: #cccccc; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.8500003814697px; line-height: 20.7900009155273px;&quot;&gt;
&lt;span style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;a href=&quot;https://github.com/juliandresog/VaadinEjemplo.git&quot; style=&quot;color: #dd7700; text-decoration: none;&quot;&gt;https://github.com/juliandresog/VaadinEjemplo.git&amp;nbsp;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vaadinspringhibernate.blogspot.com/feeds/8166879460962920787/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2011/04/vaadin-spring-e-hibernate.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/8166879460962920787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7942628804873074318/posts/default/8166879460962920787'/><link rel='alternate' type='text/html' href='http://vaadinspringhibernate.blogspot.com/2011/04/vaadin-spring-e-hibernate.html' title='Vaadin Spring e Hibernate'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>