Changeset 533 for geisa/persistence
- Timestamp:
- 07/17/12 16:37:48 (12 years ago)
- Location:
- geisa/persistence
- Files:
-
- 4 deleted
- 4 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
geisa/persistence/Persistence.iml
r437 r533 4 4 <facet type="hibernate" name="Hibernate"> 5 5 <configuration> 6 <datasource-map /> 6 <datasource-map> 7 <unit-entry name="hibernate-domain.cfg.xml" /> 8 </datasource-map> 7 9 <deploymentDescriptor name="hibernate.cfg.xml" url="file://$MODULE_DIR$/implementation/hibernate-domain.cfg.xml" /> 8 10 </configuration> -
geisa/persistence/implementation/com/ether/dao/IsotopeG03.hbm.xml
r480 r533 1 1 <?xml version="1.0"?> 2 2 <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 3 "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> 4 <!-- Generated 5 f?vr. 2007 11:07:12 by Hibernate Tools 3.2.0.b9 --> 5 <hibernate-mapping> 6 <class name="com.ether.Parameter" table="parametre" schema="public"> 7 <comment>Table enumerant les differents parametres de mesure</comment> 8 <id name="id" type="int"> 9 <column name="parametre_id" /> 10 <!--<generator class="sequence">--> 11 <!--<param name="sequence">parametre_parametre_id_seq</param>--> 12 <!--</generator>--> 3 "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> 4 <hibernate-mapping default-cascade="save-update" auto-import="false"> 5 6 <class name="com.ether.IsotopeG03" table="codes_quant_g03"> 7 8 <id name="id"> 9 <column name="idcodequant" /> 10 <generator class="increment" /> 11 12 <!-- <generator class="sequence"> --> 13 <!-- <param name="sequence">S_TABLE_TEST</param> --> 14 <!-- </generator> --> 13 15 </id> 14 16 15 <property name="name" type="string"> 16 <column name="parametre_nom" length="100" not-null="true"> 17 <comment>nom du parametre</comment> 18 </column> 17 <property name="idMole"> 18 <column name="idmole"/> 19 19 </property> 20 20 21 <set name="plateformes" inverse="true" table="requete_plat_param"> 22 <key> 23 <column name="parametre_id" not-null="true"> 24 <comment>lien vers la table parametre</comment> 25 </column> 26 </key> 27 <many-to-many entity-name="com.ether.Plateform"> 28 <column name="plateforme_id" not-null="true"> 29 <comment>lien vers la table plateforme</comment> 30 </column> 31 </many-to-many> 32 </set> 21 <property name="chMoleIsot"> 22 <column name="ch_mole_isot"/> 23 </property> 24 25 <property name="codeQuantUpper"> 26 <column name="code_quant_upper"/> 27 </property> 28 29 <property name="codeQuantLower"> 30 <column name="code_quant_lower"/> 31 </property> 32 33 <property name="nbrLignes"> 34 <column name="nbr_lignes"/> 35 </property> 36 37 <property name="wavenbMin"> 38 <column name="wavenb_min"/> 39 </property> 40 41 <property name="wavenbMax"> 42 <column name="wavenb_max"/> 43 </property> 44 33 45 </class> 34 46 </hibernate-mapping> 47 -
geisa/persistence/implementation/com/ether/dao/IsotopeG03DAOImpl.java
r480 r533 1 1 package com.ether.dao; 2 2 3 import com.ether.Parameter; 4 import com.ether.Plateform; 3 import com.ether.IsotopeG03; 5 4 import com.ether.PersistenceException; 6 5 import org.hibernate.criterion.DetachedCriteria; … … 12 11 13 12 /** 14 * @author vmipsl 15 * @date may 2011 16 * Example for a DAO 13 * @author npipsl 14 * @date july 2012 17 15 */ 18 public class PlateformDAOImpl19 extends DomainAccessObjectImpl< Plateform, Integer>20 implements PlateformDAO16 public class IsotopeG03DAOImpl 17 extends DomainAccessObjectImpl<IsotopeG03, Integer> 18 implements IsotopeG03DAO 21 19 { 22 protected PlateformDAOImpl()20 protected IsotopeG03DAOImpl() 23 21 { 24 super( Plateform.class ); 25 } 26 27 @Nullable 28 public Plateform 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 ); 22 super( IsotopeG03.class ); 35 23 } 36 24 37 25 @NotNull 38 public List< Plateform> getAllPlateforms()26 public List<IsotopeG03> getAllIsotopeG03() 39 27 throws PersistenceException 40 28 { 41 final DetachedCriteria criteria = DetachedCriteria.forClass( Plateform.class ); 42 return selectAllByCriteria( Plateform.class, criteria ); 29 final DetachedCriteria criteria = DetachedCriteria.forClass( IsotopeG03.class ); 30 return selectAllByCriteria( IsotopeG03.class, criteria ); 31 } 32 33 @NotNull 34 public List<IsotopeG03> getTransitionsByIsotopeG03Name( final String isotopeName ) 35 throws PersistenceException 36 { 37 final DetachedCriteria criteria = DetachedCriteria.forClass( IsotopeG03.class ); 38 criteria.add( Restrictions.eq( "chMoleIsot", isotopeName ) ); 39 return selectAllByCriteria( IsotopeG03.class, criteria ); 43 40 } 44 41 } -
geisa/persistence/implementation/dao-context.xml
r390 r533 4 4 <!-- Application context DAO layer --> 5 5 <beans> 6 <bean id="refPlateformDAO" class="com.ether.dao.PlateformDAOImpl"> 7 <property name="sessionFactory"> 8 <ref bean="sessionFactory" /> 9 </property> 10 </bean> 11 12 <bean id="refParameterDAO" class="com.ether.dao.ParameterDAOImpl"> 6 <bean id="refIsotopeG03DAO" class="com.ether.dao.IsotopeG03DAOImpl"> 13 7 <property name="sessionFactory"> 14 8 <ref bean="sessionFactory" /> … … 16 10 </bean> 17 11 12 <!--<bean id="refIsotopeG09DAO" class="com.ether.dao.IsotopeG09DAOImpl">--> 13 <!--<property name="sessionFactory">--> 14 <!--<ref bean="sessionFactory" />--> 15 <!--</property>--> 16 <!--</bean>--> 17 18 18 </beans> -
geisa/persistence/implementation/hibernate-domain.cfg.xml
r390 r533 6 6 <hibernate-configuration> 7 7 <session-factory> 8 <mapping resource="com/ether/dao/ Plateform.hbm.xml"/>9 < mapping resource="com/ether/dao/Parameter.hbm.xml"/>8 <mapping resource="com/ether/dao/IsotopeG03.hbm.xml"/> 9 <!--<mapping resource="com/ether/dao/IsotopeG09.hbm.xml"/>--> 10 10 </session-factory> 11 11 </hibernate-configuration> -
geisa/persistence/implementation/hibernate.cfg.xml
r390 r533 16 16 <props> 17 17 <prop key="hibernate.bytecode.use_reflection_optimizer">false</prop> 18 <prop key="hibernate.connection.driver_class">org.postgresql.Driver</prop> 19 <prop key="hibernate.connection.url">jdbc:postgresql://darkstar.ipslnet:5432/PROJECT_SOURCE</prop> 20 <prop key="hibernate.connection.username">postgres</prop> 21 <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop> 22 <prop key="hibernate.show_sql">true</prop> 18 <!--<prop key="hibernate.connection.driver_class">org.postgresql.Driver</prop>--> 19 <!--<prop key="hibernate.connection.url">jdbc:postgresql://darkstar.ipslnet:5432/PROJECT_SOURCE</prop>--> 20 <!--<prop key="hibernate.connection.username">postgres</prop>--> 21 <!--<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>--> 22 <prop key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop> 23 <prop key="hibernate.connection.url">jdbc:mysql://localhost/geisa</prop> 24 <prop key="hibernate.connection.username">root</prop> 25 <prop key="hibernate.connection.password">geisa11</prop> 26 <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> 27 <prop key="hibernate.show_sql">true</prop> 23 28 <prop key="hibernate.generate_statistics">true</prop> 24 29 </props> -
geisa/persistence/interface/com/ether/dao/IsotopeG03DAO.java
r480 r533 1 1 package com.ether.dao; 2 2 3 import com.ether. Plateform;3 import com.ether.IsotopeG03; 4 4 import com.ether.PersistenceException; 5 5 import org.jetbrains.annotations.NotNull; … … 9 9 10 10 /** 11 * @author vmipsl 12 * @date may 2011 13 * Example for a DAO 11 * @author npipsl 12 * @date july 2012 14 13 */ 15 public interface PlateformDAO16 extends DomainAccessObject< Plateform, Integer>14 public interface IsotopeG03DAO 15 extends DomainAccessObject<IsotopeG03, Integer> 17 16 { 18 @Nullable19 Plateform getPlateformById( @NotNull final Integer plateformId ) throws PersistenceException;17 // @Nullable 18 // Plateform getPlateformById( @NotNull final Integer plateformId ) throws PersistenceException; 20 19 21 20 @NotNull 22 List<Plateform> getAllPlateforms() throws PersistenceException; 21 List<IsotopeG03> getAllIsotopeG03() throws PersistenceException; 22 23 @NotNull 24 List<IsotopeG03> getTransitionsByIsotopeG03Name( final String isotopeName ) 25 throws PersistenceException; 23 26 }
Note: See TracChangeset
for help on using the changeset viewer.