de.folt.models.datamodel.sql
Class SQLMultiLingualObject

java.lang.Object
  extended by de.folt.models.datamodel.sql.SQLMultiLingualObject
All Implemented Interfaces:
java.io.Serializable

@Entity
public class SQLMultiLingualObject
extends java.lang.Object
implements java.io.Serializable

Author:
klemens
See Also:
Serialized Form

Constructor Summary
SQLMultiLingualObject()
           
 
Method Summary
 boolean addSQLMonoLingualObject(SQLMonoLingualObject mono)
          addSQLMonoLingualObject adds a MonoLingualObject to the given MultiLingualObject
 void addTmxProp(SQLTmxProp property)
          addTmxProp adds a new property to the MOL
 boolean checkIfCorePropertyExists(SQLTmxProp property)
          checkIfCorePropertyExists check if a property is a core property and if yes return true if the type exists; we only allow one core with one tyype per MOL
 java.lang.String createCSVString()
          createCSVString generates aString representation useful for csv export; separator = tab
 java.lang.String createCSVString(java.lang.String separator)
          createCSVString
 java.lang.String createCSVString(java.lang.String separator, java.lang.String nullValue, java.lang.String terminator)
          createCSVString
 java.lang.String format()
          format
 java.lang.Long getCreationTime()
           
 java.lang.Integer getId()
           
 java.lang.Long getLastAccessTime()
           
 java.util.List<SQLTmxProp> getLinguisticProperties()
           
 java.lang.Long getModificationTime()
           
 java.util.List<SQLMonoLingualObject> getMonoLingualObjects()
           
 java.util.Vector<SQLMonoLingualObject> getMonoLingualObjectsAsVector(java.lang.String targetLanguage)
          getMonoLingualObjectsAsVector
 java.lang.String getStOwner()
           
 java.lang.String getStUniqueID()
           
 java.lang.Long getUsageNumber()
           
static void main(java.lang.String[] args)
          main
 MultiLingualObject mapFrom()
          mapFrom maps a SQLMonOLingualObject to a standard MonoLinguaObject
static SQLMultiLingualObject mapTo(MultiLingualObject multi)
          mapTo maps a MultiLingualObject into a SQLMultiLingualObject
 void remove(SQLMonoLingualObject mono)
          remove removes a SQL mono from the MUL
 void setCreationTime(java.lang.Long creationTime)
           
 void setId(java.lang.Integer id)
           
 void setLastAccessTime(java.lang.Long lastAccessTime)
           
 void setLinguisticProperties(java.util.List<SQLTmxProp> linguisticProperties)
           
 void setModificationTime(java.lang.Long modificationTime)
           
 void setMonoLingualObjects(java.util.List<SQLMonoLingualObject> monoLingualObjects)
           
 void setStOwner(java.lang.String stOwner)
           
 void setStUniqueID(java.lang.String stUniqueID)
           
 void setUsageNumber(java.lang.Long usageNumber)
           
static void test()
          test a very simple test method for this class - just generates some random test data
 void updateModificationTime()
          set the modification time to the current time stamp
 void updateUsageNumber()
          increment the usage counter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLMultiLingualObject

public SQLMultiLingualObject()
Method Detail

main

public static void main(java.lang.String[] args)
main

Parameters:
args -

mapTo

public static SQLMultiLingualObject mapTo(MultiLingualObject multi)
mapTo maps a MultiLingualObject into a SQLMultiLingualObject

Parameters:
multi - the MUL to map
Returns:
the SQLMultiLingualObject

test

public static void test()
test a very simple test method for this class - just generates some random test data


addSQLMonoLingualObject

public boolean addSQLMonoLingualObject(SQLMonoLingualObject mono)
addSQLMonoLingualObject adds a MonoLingualObject to the given MultiLingualObject

Parameters:
mono - the MonoLingualObject to add
Returns:
true = success / false could not be added

addTmxProp

public void addTmxProp(SQLTmxProp property)
addTmxProp adds a new property to the MOL

Parameters:
property - the property to add

checkIfCorePropertyExists

public boolean checkIfCorePropertyExists(SQLTmxProp property)
checkIfCorePropertyExists check if a property is a core property and if yes return true if the type exists; we only allow one core with one tyype per MOL

Parameters:
property - the SQLTmxProp
Returns:
true if the combination PropType.CORE and property.getType() exists; otherwise false

createCSVString

public java.lang.String createCSVString()
createCSVString generates aString representation useful for csv export; separator = tab

Returns:
the csv export string terminated with \n

createCSVString

public java.lang.String createCSVString(java.lang.String separator)
createCSVString

Parameters:
separator - the string separator to use for marking up the fields
Returns:
the csv export string terminated with \n

createCSVString

public java.lang.String createCSVString(java.lang.String separator,
                                        java.lang.String nullValue,
                                        java.lang.String terminator)
createCSVString

Parameters:
separator - the string separator to use for marking up the fields
nullValue - the literal null value to use
Returns:
the csv export string terminated with terminator

format

public java.lang.String format()
format

Returns:
the formatted string

getCreationTime

public java.lang.Long getCreationTime()

getId

public java.lang.Integer getId()
Returns:
the id

getLastAccessTime

public java.lang.Long getLastAccessTime()
Returns:
the lastAccessTime

getLinguisticProperties

public java.util.List<SQLTmxProp> getLinguisticProperties()
Returns:
the linguisticProperties

getModificationTime

public java.lang.Long getModificationTime()

getMonoLingualObjects

public java.util.List<SQLMonoLingualObject> getMonoLingualObjects()
Returns:
the monoLingualObjects

getMonoLingualObjectsAsVector

public java.util.Vector<SQLMonoLingualObject> getMonoLingualObjectsAsVector(java.lang.String targetLanguage)
getMonoLingualObjectsAsVector

Parameters:
targetLanguage -
Returns:

getStOwner

public java.lang.String getStOwner()
Returns:
the stOwner

getStUniqueID

public java.lang.String getStUniqueID()
Returns:
the stUniqueID

getUsageNumber

public java.lang.Long getUsageNumber()

mapFrom

public MultiLingualObject mapFrom()
mapFrom maps a SQLMonOLingualObject to a standard MonoLinguaObject

Returns:
the MonoLingualObject

remove

public void remove(SQLMonoLingualObject mono)
remove removes a SQL mono from the MUL

Parameters:
mono - the SQL MOL to remove

setCreationTime

public void setCreationTime(java.lang.Long creationTime)

setId

public void setId(java.lang.Integer id)
Parameters:
id - the id to set

setLastAccessTime

public void setLastAccessTime(java.lang.Long lastAccessTime)
Parameters:
lastAccessTime - the lastAccessTime to set

setLinguisticProperties

public void setLinguisticProperties(java.util.List<SQLTmxProp> linguisticProperties)
Parameters:
linguisticProperties - the linguisticProperties to set

setModificationTime

public void setModificationTime(java.lang.Long modificationTime)

setMonoLingualObjects

public void setMonoLingualObjects(java.util.List<SQLMonoLingualObject> monoLingualObjects)
Parameters:
monoLingualObjects - the monoLingualObjects to set

setStOwner

public void setStOwner(java.lang.String stOwner)
Parameters:
stOwner - the stOwner to set

setStUniqueID

public void setStUniqueID(java.lang.String stUniqueID)
Parameters:
stUniqueID - the stUniqueID to set

setUsageNumber

public void setUsageNumber(java.lang.Long usageNumber)

updateModificationTime

public void updateModificationTime()
set the modification time to the current time stamp


updateUsageNumber

public void updateUsageNumber()
increment the usage counter