org.sciplore.resources
Class Application

java.lang.Object
  extended by org.sciplore.resources.Resource
      extended by org.sciplore.resources.Application

@Entity
public class Application
extends Resource

Resource class for applications.

Author:
Mario Lipinski <lipinski@sciplore.org>
See Also:
Resource

Constructor Summary
Application()
           
 
Method Summary
static Application getApplication(Application a)
          Returns an Application object from the database for an Application object.
static Application getApplication(Integer id)
          Returns the application object with the given identifier.
static Application getApplication(String key, String version)
          Returns an application object matching key and version.
 Integer getId()
          Returns the identifier.
 String getKey()
          Returns the application key.
 String getName()
          Returns the application's name.
 Date getReleaseDate()
          Returns the release date.
 Short getValid()
          Returns information about the validity of the record.
 String getVersion()
          Returns the version.
 void setId(Integer id)
          Sets the identifier.
 void setKey(String key)
          Sets the application key.
 void setName(String name)
          Sets the application's name.
 void setReleaseDate(Date releaseDate)
          Sets the release date.
 void setValid(Short valid)
          Sets information about the validity of the record.
 void setVersion(String version)
          Sets the version.
static Application sync(Application app)
          Synchronizes an Application object with a record from the database.
 
Methods inherited from class org.sciplore.resources.Resource
save
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Application

public Application()
Method Detail

getApplication

public static Application getApplication(Application a)
Returns an Application object from the database for an Application object.

Parameters:
a - the application object
Returns:
the application object from the database or null if not found

getApplication

public static Application getApplication(Integer id)
Returns the application object with the given identifier.

Parameters:
id - the identifier
Returns:
the application object from the database or null if not found

getApplication

public static Application getApplication(String key,
                                         String version)
Returns an application object matching key and version.

Parameters:
key - the key
version - the version
Returns:
the application object from the database or null if not found

sync

public static Application sync(Application app)
Synchronizes an Application object with a record from the database. If the object does not exist, it is added to the database. In any case related objects are synchronized as well.

Parameters:
app - the Application
Returns:
the synchronized Application which is stored in the database

getId

public Integer getId()
Returns the identifier.

Returns:
the identifier

getKey

public String getKey()
Returns the application key.

Returns:
the application key

getName

public String getName()
Returns the application's name.

Returns:
the application's name

getReleaseDate

public Date getReleaseDate()
Returns the release date.

Returns:
the release date

getValid

public Short getValid()
Returns information about the validity of the record.

Returns:
information about the validity of the record

getVersion

public String getVersion()
Returns the version.

Returns:
the version

setId

public void setId(Integer id)
Sets the identifier.

Parameters:
id - the identifier

setKey

public void setKey(String key)
Sets the application key.

Parameters:
key - the application key

setName

public void setName(String name)
Sets the application's name.

Parameters:
name - the application's name

setReleaseDate

public void setReleaseDate(Date releaseDate)
Sets the release date.

Parameters:
releaseDate - the release date

setValid

public void setValid(Short valid)
Sets information about the validity of the record.

Parameters:
valid - Information about the validity of the record.

setVersion

public void setVersion(String version)
Sets the version.

Parameters:
version - the version