Changeset 419 for tapas/persistence


Ignore:
Timestamp:
03/19/12 17:06:58 (12 years ago)
Author:
rboipsl
Message:

creation listes dans form
creation class Observatory

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  
    44<hibernate-mapping default-cascade="save-update" auto-import="false"> 
    55 
    6         <class name="com.ether.Plateform" table="plateforme"> 
     6        <class name="com.ether.tapas.Observatory" table="observatory"> 
    77 
    88                <id name="id"> 
    9                         <column name="plateforme_id" /> 
     9                        <column name="observatory_id" /> 
    1010                        <generator class="increment" /> 
    1111 
     
    1616 
    1717                <property name="name"> 
    18                         <column name="plateforme_nom"/> 
     18                        <column name="observatory_name"/> 
    1919                </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> 
    2032 
    2133        </class> 
  • tapas/persistence/implementation/com/ether/dao/ObservatoryDAOImpl.java

    r418 r419  
    33import com.ether.PersistenceException; 
    44import com.ether.Plateform; 
     5import com.ether.tapas.Observatory; 
    56import org.hibernate.criterion.DetachedCriteria; 
    67import org.hibernate.criterion.Restrictions; 
     
    1516 * Example for a DAO 
    1617 */ 
    17 public class PlateformDAOImpl 
    18         extends DomainAccessObjectImpl<Plateform, Integer> 
    19         implements PlateformDAO 
     18public class ObservatoryDAOImpl 
     19        extends DomainAccessObjectImpl<Observatory, Integer> 
     20        implements ObservatoryDAO 
    2021{ 
    21     protected PlateformDAOImpl() 
     22    protected ObservatoryDAOImpl() 
    2223    { 
    23         super( Plateform.class ); 
     24        super( Observatory.class ); 
    2425    } 
    2526 
    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() 
    2840            throws PersistenceException 
    2941    { 
    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 ); 
    4244    } 
    4345} 
  • tapas/persistence/implementation/dao-context.xml

    r412 r419  
    44<!-- Application context DAO layer --> 
    55<beans> 
    6     <bean id="refPlateformDAO" class="com.ether.dao.PlateformDAOImpl"> 
     6    <bean id="refPlateformDAO" class="com.ether.dao.ObservatoryDAOImpl"> 
    77        <property name="sessionFactory"> 
    88            <ref bean="sessionFactory"/> 
Note: See TracChangeset for help on using the changeset viewer.