$factory

( documentation for Telosys generator version 4.0.0 )


Factory providing new objects instances


Since : 3.4.0

Attributes and methods
.newBigDecimal(Double value) : BigDecimal

Creates a new instance of BigDecimal object with the given double value


Parameters :
   value : the value to be converted in BigDecimal

Example :
   #set( $var = $factory.newBigDecimal(12.4) )

Since : 3.4.0

.newBigDecimal(Integer value) : BigDecimal

Creates a new instance of BigDecimal object with the given integer value


Parameters :
   value : the value to be converted in BigDecimal

Example :
   #set( $var = $factory.newBigDecimal(20) )

Since : 3.4.0

.newBigDecimal(String value) : BigDecimal

Creates a new instance of BigDecimal object with the given string value


Parameters :
   value : the value to be converted in BigDecimal

Example :
   #set( $var = $factory.newBigDecimal("12.4") )

Since : 3.4.0

.newBigInteger(Integer value) : BigInteger

Creates a new instance of BigInteger object with the given integer value


Parameters :
   value : the value to be converted in BigInteger

Example :
   #set( $var = $factory.newBigInteger(123) )

Since : 3.4.0

.newBigInteger(String value) : BigInteger

Creates a new instance of BigInteger object with the given string value


Parameters :
   value : the value to be converted in BigInteger

Example :
   #set( $var = $factory.newBigInteger("1234") )

Since : 3.4.0

.newJdbc(EntityInContext entity) : JdbcInContext

Creates a new instance of the JDBC tool object for the given entity


Parameters :
   entity : the entity to be used (to create CRUD SQL requests, mapping, etc)

Example :
   #set( $jdbc = $factory.newJdbc($entity) )

Since : 3.4.0

.newSql(String targetDbName) : SqlInContext

Creates a new instance of SQL tool object using the default database definition (if any)
for the given target database name


Parameters :
   targetDbName : target database name (not case sensitive, eg

Example :
   #set( $sql = $factory.newSql('PostgreSQL') )

Since : 3.4.0

.newSql(String targetDbName, FileInContext targetDbConfigFile) : SqlInContext

Creates a new instance of SQL tool object using a specific database definition file
for the given target database name


Parameters :
   targetDbName : target database name ('postgresql', 'mysql', etc )
   targetDbConfigFile : target database configuration file

Example :
   #set( $sql = $factory.newSql('PostgreSQL', $fn.fileFromBundle('postgresql.properties') ) )

Since : 3.4.0