Skip to main content

Popular posts from this blog

Configuring web application with gwt+spring+hibernate

Building a web application using hibernate, spring and gwt. This time we will show how to create and cofigure an application that will use hibernate , spring and gwt. I will use HR sample database that comes with OracleXE. First , you have to create a GWT project (you can follow the steps for that on  https://developers.google.com/web-toolkit/ ) After you have the project created you need to create a tree of packages like that: Open HumanResources.gwt.xml and add the following line : By doing that you tell gwt to include model package and all dependent packages into gwt compilation Now we can start configuring spring and hibernate. to configure spring first you have to add the following lines on web.xml This will allow spring context to start doing its business. The you will have to create a field called "app-config.xml" in which you will define the settings for spring and hibernate. Over this app-config file first configure the properties as follo...

Register new WCS store view by using database

To register a new view by using SQL queries: insert into acaction (acaction_id, action) values ((select counter from keys where tablename='acaction'), 'NewView');  insert into acactactgp (ACACTGRP_ID,ACACTION_ID) values  ((SELECT ACACTGRP_ID FROM ACACTGRP WHERE GROUPNAME = 'AllSiteUsersViews'  and member_id in (select orgentity_id from orgentity where orgentityname='Root Organization')  ),  (select acaction_id from acaction where action='NewView'));  UPDATE KEYS SET COUNTER = COUNTER+1 WHERE TABLENAME = 'acaction'; commit

Configuring web application with gwt+spring+hibernate (continued)

Last Time we learned how to configure a hibernate+ spring+ GWT application. Now we will continue explaining how I built this  application. First, we'll start with the Beans. For this example we will define one bean called Regions and an interface called Bean . Region will be the pojo class that contains the mapping for HR schema regions table The  @Entity  annotation is used to mark this class as an Entity bean. To use this annotation the class must have at least a package scope no-argument constructor. The  @Table  annotation is used to specify the table to persist the data. The  name  attribute refers to the table name. If  @Table  annotation is not specified then Hibernate will by default use the class name as the table name. The  @Id  annotation is used to specify the identifier property of the entity bean. The placement of the @Id  annotation determines the default access strategy that Hibernate will use f...