Changeset 536 for geisa/persistence
- Timestamp:
- 07/25/12 18:37:30 (12 years ago)
- Location:
- geisa/persistence
- Files:
-
- 5 added
- 4 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
geisa/persistence/implementation/com/ether/dao/IsotopeG03DAOImpl.java
r533 r536 2 2 3 3 import com.ether.IsotopeG03; 4 import com.ether.Pair; 4 5 import com.ether.PersistenceException; 5 6 import org.hibernate.criterion.DetachedCriteria; 7 import org.hibernate.criterion.Projection; 8 import org.hibernate.criterion.Projections; 6 9 import org.hibernate.criterion.Restrictions; 7 10 import org.jetbrains.annotations.NotNull; 8 import org.jetbrains.annotations.Nullable;9 11 12 import java.util.HashSet; 10 13 import java.util.List; 14 import java.util.Set; 11 15 12 16 /** … … 32 36 33 37 @NotNull 34 public List<IsotopeG03> getTransitionsByIsotopeG03Name( final String isotopeName ) 38 public List<IsotopeG03> getTransitionsByIsotopeG03Name( final List<String> isotopeNameArray, final Float spectralRangeLower, final Float spectralRangeUpper ) 39 throws PersistenceException 40 { 41 final DetachedCriteria criteria = DetachedCriteria.forClass( IsotopeG03.class ); 42 criteria.add( Restrictions.in( "chMoleIsot", isotopeNameArray ) ); 43 criteria.add( Restrictions.ge( "wavenbMax", spectralRangeLower ) ); 44 criteria.add( Restrictions.le( "wavenbMin", spectralRangeUpper ) ); 45 return selectAllByCriteria( IsotopeG03.class, criteria ); 46 } 47 48 @NotNull 49 public List<IsotopeG03> getTransitionsByIsotopeG03NameByTransitionLower( final String isotopeName, final Float spectralRangeLower, final Float spectralRangeUpper , final String transitionLower) 35 50 throws PersistenceException 36 51 { 37 52 final DetachedCriteria criteria = DetachedCriteria.forClass( IsotopeG03.class ); 38 53 criteria.add( Restrictions.eq( "chMoleIsot", isotopeName ) ); 54 criteria.add( Restrictions.ge( "wavenbMax", spectralRangeLower) ); 55 criteria.add( Restrictions.le( "wavenbMin", spectralRangeUpper) ); 56 criteria.add( Restrictions.eq( "codeQuantLower",transitionLower ) ); 39 57 return selectAllByCriteria( IsotopeG03.class, criteria ); 40 58 } 59 60 @NotNull 61 public List<Pair> getTransitionsLU( final List<String> isotopeNameArray, final Float spectralRangeLower, final Float spectralRangeUpper ) 62 throws PersistenceException 63 { 64 final DetachedCriteria criteria = DetachedCriteria.forClass( IsotopeG03.class ) 65 .add( Restrictions.in( "chMoleIsot", isotopeNameArray ) ) 66 .add( Restrictions.ge( "wavenbMax", spectralRangeLower ) ) 67 .add( Restrictions.le( "wavenbMin", spectralRangeUpper ) ) 68 .setProjection( Projections.projectionList() 69 .add( Projections.property( "codeQuantUpper" ) ) 70 .add( Projections.property( "codeQuantLower" ) )); 71 72 return selectAllByCriteria( Pair.class, criteria ); 73 } 74 75 @NotNull 76 public Set<String> getTransitionsUpper( final List<String> isotopesSelectedNameList, final Float spectralRangeLower, final Float spectralRangeUpper ) 77 throws PersistenceException 78 { 79 return getTransitions(isotopesSelectedNameList, spectralRangeLower, spectralRangeUpper, true); 80 } 81 82 @NotNull 83 public Set<String> getTransitionsLower( final List<String> isotopesSelectedNameList, final Float spectralRangeLower, final Float spectralRangeUpper ) 84 throws PersistenceException 85 { 86 return getTransitions(isotopesSelectedNameList, spectralRangeLower, spectralRangeUpper, false); 87 } 88 89 @NotNull 90 private Set<String> getTransitions( final List<String> isotopesSelectedNameList, final Float spectralRangeLower, final Float spectralRangeUpper, final boolean isForLower ) 91 throws PersistenceException 92 { 93 final DetachedCriteria criteria = DetachedCriteria.forClass( IsotopeG03.class ) 94 .add( Restrictions.in( "chMoleIsot", isotopesSelectedNameList ) ) 95 .add( Restrictions.ge( "wavenbMax", spectralRangeLower ) ) 96 .add( Restrictions.le( "wavenbMin", spectralRangeUpper ) ); 97 98 if(isForLower) 99 criteria.setProjection( Projections.distinct( Projections.property( "codeQuantUpper" ) )); 100 else 101 criteria.setProjection( Projections.distinct( Projections.property( "codeQuantLower" ) )); 102 103 final List<String> transitions = selectAllByCriteria( String.class, criteria ); 104 return new HashSet<String>( transitions ); 105 } 106 41 107 } -
geisa/persistence/implementation/com/ether/dao/IsotopeG09.hbm.xml
r533 r536 4 4 <hibernate-mapping default-cascade="save-update" auto-import="false"> 5 5 6 <class name="com.ether.IsotopeG0 3" table="codes_quant_g03">6 <class name="com.ether.IsotopeG09" table="codes_quant_g09"> 7 7 8 8 <id name="id"> -
geisa/persistence/implementation/com/ether/dao/IsotopeG09DAOImpl.java
r533 r536 1 1 package com.ether.dao; 2 2 3 import com.ether.IsotopeG03; 3 import com.ether.IsotopeG09; 4 import com.ether.Pair; 4 5 import com.ether.PersistenceException; 5 6 import org.hibernate.criterion.DetachedCriteria; 7 import org.hibernate.criterion.Projections; 6 8 import org.hibernate.criterion.Restrictions; 7 9 import org.jetbrains.annotations.NotNull; 8 import org.jetbrains.annotations.Nullable;9 10 11 import java.util.HashSet; 10 12 import java.util.List; 13 import java.util.Set; 11 14 12 15 /** … … 14 17 * @date july 2012 15 18 */ 16 public class IsotopeG0 3DAOImpl17 extends DomainAccessObjectImpl<IsotopeG0 3, Integer>18 implements IsotopeG0 3DAO19 public class IsotopeG09DAOImpl 20 extends DomainAccessObjectImpl<IsotopeG09, Integer> 21 implements IsotopeG09DAO 19 22 { 20 protected IsotopeG0 3DAOImpl()23 protected IsotopeG09DAOImpl() 21 24 { 22 super( IsotopeG03.class ); 25 super( IsotopeG09.class ); 26 } 27 28 29 @NotNull 30 public Set<String> getTransitionsUpper( final List<String> isotopesSelectedNameList, final Float spectralRangeLower, final Float spectralRangeUpper ) 31 throws PersistenceException 32 { 33 return getTransitions(isotopesSelectedNameList, spectralRangeLower, spectralRangeUpper, true); 23 34 } 24 35 25 36 @NotNull 26 public List<IsotopeG03> getAllIsotopeG03()37 public Set<String> getTransitionsLower( final List<String> isotopesSelectedNameList, final Float spectralRangeLower, final Float spectralRangeUpper ) 27 38 throws PersistenceException 28 39 { 29 final DetachedCriteria criteria = DetachedCriteria.forClass( IsotopeG03.class ); 30 return selectAllByCriteria( IsotopeG03.class, criteria ); 40 return getTransitions(isotopesSelectedNameList, spectralRangeLower, spectralRangeUpper, false); 31 41 } 32 42 33 43 @NotNull 34 p ublic List<IsotopeG03> getTransitionsByIsotopeG03Name( final String isotopeName)44 private Set<String> getTransitions( final List<String> isotopesSelectedNameList, final Float spectralRangeLower, final Float spectralRangeUpper, final boolean isForLower ) 35 45 throws PersistenceException 36 46 { 37 final DetachedCriteria criteria = DetachedCriteria.forClass( IsotopeG03.class ); 38 criteria.add( Restrictions.eq( "chMoleIsot", isotopeName ) ); 39 return selectAllByCriteria( IsotopeG03.class, criteria ); 47 final DetachedCriteria criteria = DetachedCriteria.forClass( IsotopeG09.class ) 48 .add( Restrictions.in( "chMoleIsot", isotopesSelectedNameList ) ) 49 .add( Restrictions.ge( "wavenbMax", spectralRangeLower ) ) 50 .add( Restrictions.le( "wavenbMin", spectralRangeUpper ) ); 51 52 if(isForLower) 53 criteria.setProjection( Projections.distinct( Projections.property( "codeQuantUpper" ) )); 54 else 55 criteria.setProjection( Projections.distinct( Projections.property( "codeQuantLower" ) )); 56 57 final List<String> transitions = selectAllByCriteria( String.class, criteria ); 58 return new HashSet<String>( transitions ); 40 59 } 60 41 61 } -
geisa/persistence/implementation/dao-context.xml
r533 r536 10 10 </bean> 11 11 12 <!--<bean id="refIsotopeG09DAO" class="com.ether.dao.IsotopeG09DAOImpl">--> 13 <!--<property name="sessionFactory">--> 14 <!--<ref bean="sessionFactory" />--> 15 <!--</property>--> 16 <!--</bean>--> 12 <bean id="refIsotopeG09DAO" class="com.ether.dao.IsotopeG09DAOImpl"> 13 <property name="sessionFactory"> 14 <ref bean="sessionFactory" /> 15 </property> 16 </bean> 17 18 <bean id="refIsotopeIasiG03DAO" class="com.ether.dao.IsotopeIasiG03DAOImpl"> 19 <property name="sessionFactory"> 20 <ref bean="sessionFactory" /> 21 </property> 22 </bean> 23 24 <bean id="refIsotopeIasiG09DAO" class="com.ether.dao.IsotopeIasiG09DAOImpl"> 25 <property name="sessionFactory"> 26 <ref bean="sessionFactory" /> 27 </property> 28 </bean> 17 29 18 30 </beans> -
geisa/persistence/implementation/hibernate-domain.cfg.xml
r533 r536 7 7 <session-factory> 8 8 <mapping resource="com/ether/dao/IsotopeG03.hbm.xml"/> 9 <!--<mapping resource="com/ether/dao/IsotopeG09.hbm.xml"/>--> 9 <mapping resource="com/ether/dao/IsotopeG09.hbm.xml"/> 10 <mapping resource="com/ether/dao/IsotopeIasiG03.hbm.xml"/> 11 <mapping resource="com/ether/dao/IsotopeIasiG09.hbm.xml"/> 10 12 </session-factory> 11 13 </hibernate-configuration> -
geisa/persistence/interface/com/ether/dao/IsotopeG03DAO.java
r533 r536 2 2 3 3 import com.ether.IsotopeG03; 4 import com.ether.Pair; 4 5 import com.ether.PersistenceException; 5 6 import org.jetbrains.annotations.NotNull; … … 7 8 8 9 import java.util.List; 10 import java.util.Set; 9 11 10 12 /** … … 13 15 */ 14 16 public interface IsotopeG03DAO 15 17 extends DomainAccessObject<IsotopeG03, Integer> 16 18 { 17 19 // @Nullable … … 22 24 23 25 @NotNull 24 List<IsotopeG03> getTransitionsByIsotopeG03Name( final String isotopeName ) 26 List<IsotopeG03> getTransitionsByIsotopeG03Name( final List<String> isotopeNameArray, final Float spectralRangeLower, final Float spectralRangeUpper) 27 throws PersistenceException; 28 29 @NotNull 30 List<IsotopeG03> getTransitionsByIsotopeG03NameByTransitionLower( final String isotopeName, final Float spectralRangeLower, final Float spectralRangeUpper, final String transitionLower) 31 throws PersistenceException; 32 33 @NotNull 34 List<Pair> getTransitionsLU( final List<String> isotopeNameArray,final Float spectralRangeLower, final Float spectralRangeUpper ) 35 throws PersistenceException; 36 37 @NotNull 38 Set<String> getTransitionsLower(final List<String> isotopesSelectedNameList,final Float spectralRangeLower, final Float spectralRangeUpper ) 39 throws PersistenceException; 40 41 @NotNull 42 Set<String> getTransitionsUpper(final List<String> isotopesSelectedNameList,final Float spectralRangeLower, final Float spectralRangeUpper ) 25 43 throws PersistenceException; 26 44 } -
geisa/persistence/interface/com/ether/dao/IsotopeG09DAO.java
r533 r536 1 1 package com.ether.dao; 2 2 3 import com.ether.IsotopeG03; 3 4 import com.ether.IsotopeG09; 5 import com.ether.Pair; 4 6 import com.ether.PersistenceException; 5 7 import org.jetbrains.annotations.NotNull; 6 import org.jetbrains.annotations.Nullable;7 8 8 9 import java.util.List; 10 import java.util.Set; 9 11 10 12 /** … … 12 14 * @date july 2012 13 15 */ 14 public interface IsotopeG0 3DAO15 extends DomainAccessObject<IsotopeG03, Integer>16 public interface IsotopeG09DAO 17 extends DomainAccessObject<IsotopeG09, Integer> 16 18 { 17 // @Nullable 18 // Plateform getPlateformById( @NotNull final Integer plateformId ) throws PersistenceException; 19 @NotNull 20 Set<String> getTransitionsLower( final List<String> isotopesSelectedNameList, final Float spectralRangeLower, final Float spectralRangeUpper ) 21 throws PersistenceException; 19 22 20 23 @NotNull 21 List<IsotopeG03> getAllIsotopeG03() throws PersistenceException; 22 23 @NotNull 24 List<IsotopeG03> getTransitionsByIsotopeG03Name( final String isotopeName ) 24 Set<String> getTransitionsUpper( final List<String> isotopesSelectedNameList, final Float spectralRangeLower, final Float spectralRangeUpper ) 25 25 throws PersistenceException; 26 26 } -
geisa/persistence/interface/com/ether/dao/IsotopeIasiG03DAO.java
r533 r536 1 1 package com.ether.dao; 2 2 3 import com.ether.IsotopeG03; 3 import com.ether.IsotopeIasiG03; 4 import com.ether.Pair; 4 5 import com.ether.PersistenceException; 5 6 import org.jetbrains.annotations.NotNull; 6 import org.jetbrains.annotations.Nullable;7 7 8 8 import java.util.List; 9 import java.util.Set; 9 10 10 11 /** … … 12 13 * @date july 2012 13 14 */ 14 public interface Isotope G03DAO15 extends DomainAccessObject<IsotopeG03, Integer>15 public interface IsotopeIasiG03DAO 16 extends DomainAccessObject<IsotopeIasiG03, Integer> 16 17 { 17 18 // @Nullable 18 19 // Plateform getPlateformById( @NotNull final Integer plateformId ) throws PersistenceException; 19 20 20 @NotNull21 List<IsotopeG03> getAllIsotopeG03() throws PersistenceException;22 21 23 22 @NotNull 24 List<IsotopeG03> getTransitionsByIsotopeG03Name( final String isotopeName ) 23 Set<String> getTransitionsLower( final List<String> isotopesSelectedNameList, final Float spectralRangeLower, final Float spectralRangeUpper ) 24 throws PersistenceException; 25 26 @NotNull 27 Set<String> getTransitionsUpper( final List<String> isotopesSelectedNameList, final Float spectralRangeLower, final Float spectralRangeUpper ) 25 28 throws PersistenceException; 26 29 }
Note: See TracChangeset
for help on using the changeset viewer.