Changeset 419 for tapas/persistence
- Timestamp:
- 03/19/12 17:06:58 (12 years ago)
- Location:
- tapas/persistence
- Files:
-
- 1 added
- 1 deleted
- 1 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
tapas/persistence/implementation/com/ether/dao/Observatory.hbm.xml
r418 r419 4 4 <hibernate-mapping default-cascade="save-update" auto-import="false"> 5 5 6 <class name="com.ether. Plateform" table="plateforme">6 <class name="com.ether.tapas.Observatory" table="observatory"> 7 7 8 8 <id name="id"> 9 <column name=" plateforme_id" />9 <column name="observatory_id" /> 10 10 <generator class="increment" /> 11 11 … … 16 16 17 17 <property name="name"> 18 <column name=" plateforme_nom"/>18 <column name="observatory_name"/> 19 19 </property> 20 21 <property name="latitude"> 22 <column name="observatory_latitude"/> 23 </property> 24 25 <property name="longitude"> 26 <column name="observatory_longitude"/> 27 </property> 28 29 <property name="altitude"> 30 <column name="observatory_altitude"/> 31 </property> 20 32 21 33 </class> -
tapas/persistence/implementation/com/ether/dao/ObservatoryDAOImpl.java
r418 r419 3 3 import com.ether.PersistenceException; 4 4 import com.ether.Plateform; 5 import com.ether.tapas.Observatory; 5 6 import org.hibernate.criterion.DetachedCriteria; 6 7 import org.hibernate.criterion.Restrictions; … … 15 16 * Example for a DAO 16 17 */ 17 public class PlateformDAOImpl18 extends DomainAccessObjectImpl< Plateform, Integer>19 implements PlateformDAO18 public class ObservatoryDAOImpl 19 extends DomainAccessObjectImpl<Observatory, Integer> 20 implements ObservatoryDAO 20 21 { 21 protected PlateformDAOImpl()22 protected ObservatoryDAOImpl() 22 23 { 23 super( Plateform.class );24 super( Observatory.class ); 24 25 } 25 26 26 @Nullable 27 public Plateform getPlateformById( @NotNull final Integer plateformId ) 27 // @Nullable 28 // public Observatory getPlateformById( @NotNull final Integer plateformId ) 29 // throws PersistenceException 30 // { 31 // final DetachedCriteria criteria = DetachedCriteria.forClass( Plateform.class ) 32 // .add( Restrictions.idEq( plateformId ) ); 33 // 34 // return selectByCriteria( Plateform.class, criteria ); 35 // } 36 37 38 @NotNull 39 public List<Observatory> getAllObservatories() 28 40 throws PersistenceException 29 41 { 30 final DetachedCriteria criteria = DetachedCriteria.forClass( Plateform.class ) 31 .add( Restrictions.idEq( plateformId ) ); 32 33 return selectByCriteria( Plateform.class, criteria ); 34 } 35 36 @NotNull 37 public List<Plateform> getAllPlateforms() 38 throws PersistenceException 39 { 40 final DetachedCriteria criteria = DetachedCriteria.forClass( Plateform.class ); 41 return selectAllByCriteria( Plateform.class, criteria ); 42 final DetachedCriteria criteria = DetachedCriteria.forClass( Observatory.class ); 43 return selectAllByCriteria( Observatory.class, criteria ); 42 44 } 43 45 } -
tapas/persistence/implementation/dao-context.xml
r412 r419 4 4 <!-- Application context DAO layer --> 5 5 <beans> 6 <bean id="refPlateformDAO" class="com.ether.dao. PlateformDAOImpl">6 <bean id="refPlateformDAO" class="com.ether.dao.ObservatoryDAOImpl"> 7 7 <property name="sessionFactory"> 8 8 <ref bean="sessionFactory"/>
Note: See TracChangeset
for help on using the changeset viewer.