/*
* EuroCarbDB, a framework for carbohydrate bioinformatics
*
* Copyright (c) 2006-2009, Eurocarb project, or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
* A copy of this license accompanies this distribution in the file LICENSE.txt.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* Last commit: $Rev: 1997 $ by $Author: hasysf@gmail.com $ on $Date:: 2010-11-09 #$
*/
// Generated Apr 3, 2007 6:49:19 PM by Hibernate Tools 3.1.0.beta4
package org.eurocarbdb.dataaccess.ms;
// stdlib imports
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.io.Serializable;
// eurocarb imports
import org.eurocarbdb.dataaccess.BasicEurocarbObject;
import static org.eurocarbdb.dataaccess.Eurocarb.getEntityManager;
/* class Device *//**********************************************
*
*
*/
public class Device extends BasicEurocarbObject implements Serializable
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~ FIELDS ~~~~~~~~~~~~~~~~~~~~~~~~~~~//
private int deviceId;
private Manufacturer manufacturer;
private String model;
private String ionisationType;
private Set<Source> sources = new HashSet<Source>(0);
private Set<FragmentationType> fragmentationTypes = new HashSet<FragmentationType>(0);
private Set<Analyser> analysers = new HashSet<Analyser>(0);
private Set<Laser> lasers = new HashSet<Laser>(0);
private Set<Acquisition> acquisitions = new HashSet<Acquisition>(0);
private Set<MassDetector> massDetectors = new HashSet<MassDetector>(0);
//~~~~~~~~~~~~~~~~~~~~~~~ CONSTRUCTORS ~~~~~~~~~~~~~~~~~~~~~~~~//
/** Default constructor. */
public Device() {}
/** Minimal constructor */
public Device( Manufacturer manufacturer, String model, String ionisationType )
{
this.manufacturer = manufacturer;
this.model = model;
this.ionisationType = ionisationType;
}
/** full constructor */
public Device( Manufacturer manufacturer, String model, String ionisationType, Set<Source> sources, Set<FragmentationType> fragmentationTypes, Set<Analyser> analysers, Set<Laser> lasers, Set<Acquisition> acquisitions, Set<MassDetector> massDetectors )
{
this.manufacturer = manufacturer;
this.model = model;
this.ionisationType = ionisationType;
this.sources = sources;
this.fragmentationTypes = fragmentationTypes;
this.analysers = analysers;
this.lasers = lasers;
this.acquisitions = acquisitions;
this.massDetectors = massDetectors;
}
//~~~~~~~~~~~~~~~~~~~~~~ STATIC METHODS ~~~~~~~~~~~~~~~~~~~~~~~//
/** Returns the {@link List} of all {@link Device}s. */
@SuppressWarnings("unchecked")
public static List<Device> getAllDevices()
{
return (List<Device>) getEntityManager()
.getQuery("org.eurocarbdb.dataaccess.ms.Device.GET_ALL")
.list();
}
//~~~~~~~~~~~~~~~~~~~~~~~~~ METHODS ~~~~~~~~~~~~~~~~~~~~~~~~~~~//
/* getDeviceId *//********************************
*
*/
public int getDeviceId()
{
return this.deviceId;
}
/* setDeviceId *//********************************
*
*/
public void setDeviceId( int deviceId )
{
this.deviceId = deviceId;
}
/* getManufacturer *//********************************
*
*/
public Manufacturer getManufacturer()
{
return this.manufacturer;
}
/* setManufacturer *//********************************
*
*/
public void setManufacturer( Manufacturer manufacturer )
{
this.manufacturer = manufacturer;
}
/* getModel *//********************************
*
*/
public String getModel()
{
return this.model;
}
/* setModel *//********************************
*
*/
public void setModel( String model )
{
this.model = model;
}
/**
* Get the full model name for this device, generated by concatenating
* the manufacturer and model names together
*/
public String getFullModelName()
{
return this.manufacturer.getName() + " " + this.model;
}
/* getIonisationType *//********************************
*
*/
public String getIonisationType()
{
return this.ionisationType;
}
/* setIonisationType *//********************************
*
*/
public void setIonisationType( String ionisationType )
{
this.ionisationType = ionisationType;
}
/* getSources *//********************************
*
*/
public Set<Source> getSources()
{
return this.sources;
}
/* setSources *//********************************
*
*/
public void setSources( Set<Source> sources )
{
this.sources = sources;
}
/* getFragmentationTypes *//********************************
*
*/
public Set<FragmentationType> getFragmentationTypes()
{
return this.fragmentationTypes;
}
/* setFragmentationTypes *//********************************
*
*/
public void setFragmentationTypes( Set<FragmentationType> fragmentationTypes )
{
this.fragmentationTypes = fragmentationTypes;
}
/* getAnalysers *//********************************
*
*/
public Set<Analyser> getAnalysers()
{
return this.analysers;
}
/* setAnalysers *//********************************
*
*/
public void setAnalysers( Set<Analyser> analysers )
{
this.analysers = analysers;
}
/* getLasers *//********************************
*
*/
public Set<Laser> getLasers()
{
return this.lasers;
}
/* setLasers *//********************************
*
*/
public void setLasers( Set<Laser> lasers )
{
this.lasers = lasers;
}
/* getAcquisitions *//********************************
*
*/
public Set<Acquisition> getAcquisitions()
{
return this.acquisitions;
}
/* setAcquisitions *//********************************
*
*/
public void setAcquisitions( Set<Acquisition> acquisitions )
{
this.acquisitions = acquisitions;
}
/* getMassDetectors *//********************************
*
*/
public Set<MassDetector> getMassDetectors()
{
return this.massDetectors;
}
/* setMassDetectors *//********************************
*
*/
public void setMassDetectors( Set<MassDetector> massDetectors )
{
this.massDetectors = massDetectors;
}
public static Device getDeviceByName(String dname)
{
Object i=getEntityManager().getQuery("org.eurocarbdb.dataaccess.ms.Device.GET_DEV")
.setParameter("model",dname)
.uniqueResult();
assert i instanceof Device;
return (Device) i;
}// end method
public static Device getByModelAndManufacturer(String model, int manufacturerId){
Object i=getEntityManager().getQuery("org.eurocarbdb.dataaccess.ms.Device.GET_MOD_AND_MAN")
.setParameter("model",model)
.setParameter("manufacturerId",manufacturerId)
.uniqueResult();
assert i instanceof Device;
return (Device) i;
}
} // end class