de.folt.models.datamodel.sql
Class SQLMonoLingualObject

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

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

Author:
klemens
See Also:
Serialized Form

Constructor Summary
SQLMonoLingualObject()
           
SQLMonoLingualObject(java.lang.String formattedSegment, java.lang.String language)
           
SQLMonoLingualObject(java.lang.String formattedSegment, java.lang.String language, java.lang.Class classname, java.lang.reflect.Method determinePlaintext, java.lang.Object params)
           
 
Method Summary
 void addTmxProp(SQLTmxProp property)
          addTmxProp adds a new property to the MOL
 void addTmxProp(java.lang.String type, java.lang.String content)
          addTmxProp
 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
 void clearObject()
           
 java.lang.String createCSVString()
          createCSVString generates aString representation useful for csv export; separator = \t tab
 java.lang.String createCSVString(java.lang.String separator)
          createCSVString generates aString representation useful for csv export; separator supplied
 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.String getFormattedSegment()
           
 java.lang.Integer getId()
           
 java.lang.String getLanguage()
           
 java.lang.Long getLastAccessTime()
           
 GeneralLinguisticObject.LinguisticTypes getLingType()
           
 java.util.List<SQLTmxProp> getLinguisticProperties()
           
 java.lang.Long getModificationTime()
           
 SQLMultiLingualObject getParentMultiLingualObject()
           
 java.lang.String getPlainTextSegment()
           
 java.lang.String getStOwner()
           
 java.lang.String getStUniqueID()
           
 java.lang.Long getUsageNumber()
           
static void main(java.lang.String[] args)
          main
 MonoLingualObject mapFrom()
          mapFrom maps a SQLMonOLingualObject to a standard MonoLinguaObject
static SQLMonoLingualObject mapTo(MonoLingualObject mono, SQLMultiLingualObject sqlmulti)
          mapTo maps a MonoLingualObject into a SQLMonoLingualObject
 void setCreationTime(java.lang.Long creationTime)
           
 void setFormattedSegment(java.lang.String formattedSegment)
           
 void setId(java.lang.Integer id)
           
 void setLanguage(java.lang.String language)
           
 void setLastAccessTime(java.lang.Long lastAccessTime)
           
 void setLingType(GeneralLinguisticObject.LinguisticTypes lingType)
           
 void setLinguisticProperties(java.util.List<SQLTmxProp> linguisticProperties)
           
 void setModificationTime(java.lang.Long modificationTime)
           
 void setParentMultiLingualObject(SQLMultiLingualObject parentMultiLingualObject)
           
 void setPlainTextSegment(java.lang.String plainTextSegment)
           
 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

SQLMonoLingualObject

public SQLMonoLingualObject()

SQLMonoLingualObject

public SQLMonoLingualObject(java.lang.String formattedSegment,
                            java.lang.String language)
Parameters:
formattedSegment - the formatted Segment; plaintextsegment is set to the formattedSegment
language - the language of the segment

SQLMonoLingualObject

public SQLMonoLingualObject(java.lang.String formattedSegment,
                            java.lang.String language,
                            java.lang.Class classname,
                            java.lang.reflect.Method determinePlaintext,
                            java.lang.Object params)
Parameters:
formattedSegment -
language -
classname -
determinePlaintext -
params -
Method Detail

main

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

Parameters:
args -

mapTo

public static SQLMonoLingualObject mapTo(MonoLingualObject mono,
                                         SQLMultiLingualObject sqlmulti)
mapTo maps a MonoLingualObject into a SQLMonoLingualObject

Parameters:
mono - the MOL to map
Returns:
the SQLMonoLingualObject

test

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


addTmxProp

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

Parameters:
property - the property to add

addTmxProp

public void addTmxProp(java.lang.String type,
                       java.lang.String content)
addTmxProp

Parameters:
type - the type of the property
content - the value for the property

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

clearObject

public void clearObject()

createCSVString

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

Returns:
the csv export string terminated with \n

createCSVString

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

Parameters:
separator - the separator to use
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 separator to use
nullValue - the null value to use
terminator - the terminator 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()

getFormattedSegment

public java.lang.String getFormattedSegment()
Returns:
the formattedSegment

getId

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

getLanguage

public java.lang.String getLanguage()
Returns:
the language

getLastAccessTime

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

getLingType

public GeneralLinguisticObject.LinguisticTypes getLingType()
Returns:
the lingType

getLinguisticProperties

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

getModificationTime

public java.lang.Long getModificationTime()

getParentMultiLingualObject

public SQLMultiLingualObject getParentMultiLingualObject()
Returns:
the parentMultiLingualObject

getPlainTextSegment

public java.lang.String getPlainTextSegment()
Returns:
the plainTextSegment

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 MonoLingualObject mapFrom()
mapFrom maps a SQLMonOLingualObject to a standard MonoLinguaObject

Returns:
the MonoLingualObject

setCreationTime

public void setCreationTime(java.lang.Long creationTime)

setFormattedSegment

public void setFormattedSegment(java.lang.String formattedSegment)
Parameters:
formattedSegment - the formattedSegment to set

setId

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

setLanguage

public void setLanguage(java.lang.String language)
Parameters:
language - the language to set

setLastAccessTime

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

setLingType

public void setLingType(GeneralLinguisticObject.LinguisticTypes lingType)
Parameters:
lingType - the lingType 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)

setParentMultiLingualObject

public void setParentMultiLingualObject(SQLMultiLingualObject parentMultiLingualObject)
Parameters:
parentMultiLingualObject - the parentMultiLingualObject to set

setPlainTextSegment

public void setPlainTextSegment(java.lang.String plainTextSegment)
Parameters:
plainTextSegment - the plainTextSegment 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