Changeset 640

Show
Ignore:
Timestamp:
11/13/07 14:49:43 (1 year ago)
Author:
laurentj
Message:

enhancement #230: new 'default' attribute on dao properties, to indicate the default value
fixed bug #336: list of field generated by sqlite driver was bad
little improvements/bug fixed in tools of pgsql and mysql driver

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/manifests/testapp.mn

    r639 r640  
    122122  jdb.2_queries_with_pdo.html.php 
    123123  jdb.pgsql.html.php 
     124  jdb.sqlite.html.php 
    124125  jforms.html.php 
    125126  jforms.check_datas.html.php 
     
    152153cd testapp/var/overloads/testapp/daos 
    153154cd testapp/var/overloads/testapp/locales 
     155cd testapp/var/db/sqlite/ 
     156  tests.sqlite 
    154157 
    155158cd temp/testapp 
  • trunk/build/manifests/testapp.mn

    r639 r640  
    122122  jdb.2_queries_with_pdo.html.php 
    123123  jdb.pgsql.html.php 
     124  jdb.sqlite.html.php 
    124125  jforms.html.php 
    125126  jforms.check_datas.html.php 
     
    152153cd testapp/var/overloads/testapp/daos 
    153154cd testapp/var/overloads/testapp/locales 
     155cd testapp/var/db/sqlite/ 
     156  tests.sqlite 
    154157 
    155158cd temp/testapp 
  • trunk/lib/jelix-scripts/commands/createdao.cmd.php

    r639 r640  
    136136                     $primarykeys.=$fieldname; 
    137137               } 
    138                if($prop->notNull && !$prop->auto_increment) 
     138               if($prop->notNull && !$prop->autoIncrement) 
    139139                  $properties.=' required="true"'; 
     140 
     141               if($prop->hasDefault) { 
     142                   $properties.=' default="'.htmlspecialchars($prop->default).'"'; 
     143               } 
     144               if ($prop->length) { 
     145                    $properties.=' maxlength="'.$prop->length.'"'; 
     146               } 
    140147               $properties.='/>'; 
    141148            } 
  • trunk/lib/jelix-scripts/commands/createdao.cmd.php

    r639 r640  
    136136                     $primarykeys.=$fieldname; 
    137137               } 
    138                if($prop->notNull && !$prop->auto_increment) 
     138               if($prop->notNull && !$prop->autoIncrement) 
    139139                  $properties.=' required="true"'; 
     140 
     141               if($prop->hasDefault) { 
     142                   $properties.=' default="'.htmlspecialchars($prop->default).'"'; 
     143               } 
     144               if ($prop->length) { 
     145                    $properties.=' maxlength="'.$prop->length.'"'; 
     146               } 
    140147               $properties.='/>'; 
    141148            } 
  • trunk/lib/jelix/dao/jDaoGenerator.class.php

    r638 r640  
    9191      foreach ($this->_datasParser->getProperties() as $id=>$field){ 
    9292          $properties[$id] = get_object_vars($field); 
    93           $src[] =' public $'.$id.';'; 
     93          if($field->defaultValue !== null) 
     94              $src[] =' public $'.$id.'='.var_export($field->defaultValue, true).';'; 
     95          else 
     96              $src[] =' public $'.$id.';'; 
    9497      } 
    9598 
  • trunk/lib/jelix/dao/jDaoGenerator.class.php

    r638 r640  
    9191      foreach ($this->_datasParser->getProperties() as $id=>$field){ 
    9292          $properties[$id] = get_object_vars($field); 
    93           $src[] =' public $'.$id.';'; 
     93          if($field->defaultValue !== null) 
     94              $src[] =' public $'.$id.'='.var_export($field->defaultValue, true).';'; 
     95          else 
     96              $src[] =' public $'.$id.';'; 
    9497      } 
    9598 
  • trunk/lib/jelix/dao/jDaoParser.class.php

    r639 r640  
    281281    public $ofPrimaryTable = true; 
    282282 
     283    public $defaultValue = null; 
    283284    /** 
    284285    * constructor. 
     
    286287    function __construct ($aParams, $def){ 
    287288        $needed = array('name', 'fieldname', 'table', 'datatype', 'required', 'minlength', 
    288         'maxlength', 'regexp', 'sequence'); 
     289        'maxlength', 'regexp', 'sequence', 'default'); 
    289290 
    290291        $params = $def->getAttr($aParams, $needed); 
     
    313314        $this->minlength  = $params['minlength'] !== null ? intval($params['minlength']) : null; 
    314315        $this->regExp     = $params['regexp']; 
    315  
    316316 
    317317        if ($params['datatype']===null){ 
     
    341341            $this->required = false; 
    342342            $this->requiredInConditions = true; 
     343        } 
     344 
     345        if($params['default'] !== null) { 
     346            switch($this->datatype) { 
     347              case 'autoincrement': 
     348              case 'int': 
     349              case 'integer': 
     350                $this->defaultValue = intval($params['default']); 
     351                break; 
     352              case 'double': 
     353              case 'float': 
     354                $this->defaultValue = doubleval($params['default']); 
     355                break; 
     356              default: 
     357                $this->defaultValue = $params['default']; 
     358            } 
    343359        } 
    344360 
  • trunk/lib/jelix/dao/jDaoParser.class.php

    r639 r640  
    281281    public $ofPrimaryTable = true; 
    282282 
     283    public $defaultValue = null; 
    283284    /** 
    284285    * constructor. 
     
    286287    function __construct ($aParams, $def){ 
    287288        $needed = array('name', 'fieldname', 'table', 'datatype', 'required', 'minlength', 
    288         'maxlength', 'regexp', 'sequence'); 
     289        'maxlength', 'regexp', 'sequence', 'default'); 
    289290 
    290291        $params = $def->getAttr($aParams, $needed); 
     
    313314        $this->minlength  = $params['minlength'] !== null ? intval($params['minlength']) : null; 
    314315        $this->regExp     = $params['regexp']; 
    315  
    316316 
    317317        if ($params['datatype']===null){ 
     
    341341            $this->required = false; 
    342342            $this->requiredInConditions = true; 
     343        } 
     344 
     345        if($params['default'] !== null) { 
     346            switch($this->datatype) { 
     347              case 'autoincrement': 
     348              case 'int': 
     349              case 'integer': 
     350                $this->defaultValue = intval($params['default']); 
     351                break; 
     352              case 'double': 
     353              case 'float': 
     354                $this->defaultValue = doubleval($params['default']); 
     355                break; 
     356              default: 
     357                $this->defaultValue = $params['default']; 
     358            } 
    343359        } 
    344360 
  • trunk/lib/jelix/plugins/db/mysql/mysql.dbtools.php

    r639 r640  
    2828    function _getTableList (){ 
    2929        $results = array (); 
    30      
     30 
    3131        $rs = $this->_connector->query ('SHOW TABLES FROM '.$this->_connector->profil['database']); 
    3232        $col_name = 'Tables_in_'.$this->_connector->profil['database']; 
    33      
     33 
    3434        while ($line = $rs->fetch ()){ 
    3535            $results[] = $line->$col_name; 
    3636        } 
    37      
     37 
    3838        return $results; 
    3939    } 
     
    4545    function _getFieldList ($tableName){ 
    4646        $results = array (); 
    47      
     47 
    4848        $rs = $this->_connector->query ('SHOW FIELDS FROM ' . $tableName); 
    49      
     49 
    5050        while ($line = $rs->fetch ()){ 
    5151            $field = new jDbFieldProperties(); 
    52             preg_match('/^(\w+).*$/',$line->Type,$m); 
    53             $field->type = $m[1]; 
     52 
     53            if (preg_match('/^(\w+)\s*(\((\d+)\))?.*$/',$line->Type,$m)) { 
     54                $field->type = strtolower($m[1]); 
     55                if ($field->type == 'varchar' && isset($m[3])) { 
     56                    $field->length = intval($m[3]); 
     57                } 
     58            } else { 
     59                $field->type = $line->Type; 
     60            } 
     61 
    5462            $field->name = $line->Field; 
    5563            $field->notNull = ($line->Null == 'NO'); 
  • trunk/lib/jelix/plugins/db/mysql/mysql.dbtools.php

    r639 r640  
    2828    function _getTableList (){ 
    2929        $results = array (); 
    30      
     30 
    3131        $rs = $this->_connector->query ('SHOW TABLES FROM '.$this->_connector->profil['database']); 
    3232        $col_name = 'Tables_in_'.$this->_connector->profil['database']; 
    33      
     33 
    3434        while ($line = $rs->fetch ()){ 
    3535            $results[] = $line->$col_name; 
    3636        } 
    37      
     37 
    3838        return $results; 
    3939    } 
     
    4545    function _getFieldList ($tableName){ 
    4646        $results = array (); 
    47      
     47 
    4848        $rs = $this->_connector->query ('SHOW FIELDS FROM ' . $tableName); 
    49      
     49 
    5050        while ($line = $rs->fetch ()){ 
    5151            $field = new jDbFieldProperties(); 
    52             preg_match('/^(\w+).*$/',$line->Type,$m); 
    53             $field->type = $m[1]; 
     52 
     53            if (preg_match('/^(\w+)\s*(\((\d+)\))?.*$/',$line->Type,$m)) { 
     54                $field->type = strtolower($m[1]); 
     55                if ($field->type == 'varchar' && isset($m[3])) { 
     56                    $field->length = intval($m[3]); 
     57                } 
     58            } else { 
     59                $field->type = $line->Type; 
     60            } 
     61 
    5462            $field->name = $line->Field; 
    5563            $field->notNull = ($line->Null == 'NO'); 
  • trunk/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php

    r631 r640  
    6464 
    6565    protected function _connect (){ 
    66         $funcconnect= ($this->profil['persistent'] ? 'pg_pconnect':'pg_connect'); 
     66        $funcconnect= (isset($this->profil['persistent']) && $this->profil['persistent'] ? 'pg_pconnect':'pg_connect'); 
    6767 
    6868        $str = ''; 
  • trunk/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php

    r631 r640  
    6464 
    6565    protected function _connect (){ 
    66         $funcconnect= ($this->profil['persistent'] ? 'pg_pconnect':'pg_connect'); 
     66        $funcconnect= (isset($this->profil['persistent']) && $this->profil['persistent'] ? 'pg_pconnect':'pg_connect'); 
    6767 
    6868        $str = ''; 
  • trunk/lib/jelix/plugins/db/pgsql/pgsql.dbtools.php

    r639 r640  
    5454 
    5555        // get field informations 
    56         $sql_get_fields = "SELECT t.typname, a.attname, a.attnotnull, a.attnum, 
     56        $sql_get_fields = "SELECT t.typname, a.attname, a.attnotnull, a.attnum, a.attlen, a.atttypmod, 
    5757        a.atthasdef, d.adsrc 
    5858        FROM pg_type t, pg_attribute a LEFT JOIN pg_attrdef d ON (d.adrelid=a.attrelid AND d.adnum=a.attnum) 
     
    6060          a.attnum > 0 AND a.attrelid = ".$table->oid." AND a.atttypid = t.oid 
    6161        ORDER BY a.attnum"; 
    62          
     62 
    6363        $toReturn=array(); 
    6464        $rs = $this->_connector->query ($sql_get_fields); 
     
    7575                $field->default = ''; 
    7676            } 
    77              
     77 
    7878            if(in_array($line->attnum, $pkeys)) 
    7979                $field->primary = true; 
    80              
     80 
     81            if($line->attlen == -1 && $line->atttypmod != -1) 
     82                $field->length = $line->atttypmod - 4; 
     83 
    8184            $toReturn[$line->attname]=$field; 
    8285        } 
  • trunk/lib/jelix/plugins/db/pgsql/pgsql.dbtools.php

    r639 r640  
    5454 
    5555        // get field informations 
    56         $sql_get_fields = "SELECT t.typname, a.attname, a.attnotnull, a.attnum, 
     56        $sql_get_fields = "SELECT t.typname, a.attname, a.attnotnull, a.attnum, a.attlen, a.atttypmod, 
    5757        a.atthasdef, d.adsrc 
    5858        FROM pg_type t, pg_attribute a LEFT JOIN pg_attrdef d ON (d.adrelid=a.attrelid AND d.adnum=a.attnum) 
     
    6060          a.attnum > 0 AND a.attrelid = ".$table->oid." AND a.atttypid = t.oid 
    6161        ORDER BY a.attnum"; 
    62          
     62 
    6363        $toReturn=array(); 
    6464        $rs = $this->_connector->query ($sql_get_fields); 
     
    7575                $field->default = ''; 
    7676            } 
    77              
     77 
    7878            if(in_array($line->attnum, $pkeys)) 
    7979                $field->primary = true; 
    80              
     80 
     81            if($line->attlen == -1 && $line->atttypmod != -1) 
     82                $field->length = $line->atttypmod - 4; 
     83 
    8184            $toReturn[$line->attname]=$field; 
    8285        } 
  • trunk/lib/jelix/plugins/db/sqlite/sqlite.dbconnection.php

    r629 r640  
    6161 
    6262    protected function _connect (){ 
    63         $funcconnect= ($this->profil['persistent']? 'sqlite_popen':'sqlite_open'); 
     63        $funcconnect= (isset($this->profil['persistent']) && $this->profil['persistent']? 'sqlite_popen':'sqlite_open'); 
    6464        if ($cnx = @$funcconnect(JELIX_APP_VAR_PATH. 'db/sqlite/'.$this->profil['database'])) { 
    6565            return $cnx; 
  • trunk/lib/jelix/plugins/db/sqlite/sqlite.dbconnection.php

    r629 r640  
    6161 
    6262    protected function _connect (){ 
    63         $funcconnect= ($this->profil['persistent']? 'sqlite_popen':'sqlite_open'); 
     63        $funcconnect= (isset($this->profil['persistent']) && $this->profil['persistent']? 'sqlite_popen':'sqlite_open'); 
    6464        if ($cnx = @$funcconnect(JELIX_APP_VAR_PATH. 'db/sqlite/'.$this->profil['database'])) { 
    6565            return $cnx; 
  • trunk/lib/jelix/plugins/db/sqlite/sqlite.dbtools.php

    r639 r640  
    44* @subpackage db_driver 
    55* @author     Loic Mathaud 
    6 * @contributor 
    7 * @copyright  2006 Loic Mathaud 
     6* @contributor Laurent Jouanneau 
     7* @copyright  2006 Loic Mathaud, 2007 Laurent Jouanneau 
    88* @link      http://www.jelix.org 
    99* @licence  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    1616 */ 
    1717class sqliteDbTools extends jDbTools { 
    18     function __construct($connector){ 
    19         parent::__construct($connector); 
    20     } 
    2118 
    2219    /** 
     
    2421    * @return   array    $tab[] = $nomDeTable 
    2522    */ 
    26     function _getTableList (){ 
     23    protected function _getTableList (){ 
    2724        $results = array (); 
    2825 
     
    4037    * @return   array    $tab[NomDuChamp] = obj avec prop (tye, length, lengthVar, notnull) 
    4138    */ 
    42     function _getFieldList ($tableName)
     39    protected function _getFieldList ($tableName)
    4340        $results = array (); 
    44  
    45         $query = "SELECT sql FROM sqlite_master WHERE tbl_name= '". $tableName ."'"; 
    46         $rs = $this->_connector->query($query); 
    47         $rs_line = $rs->fetch(); 
    48         $create_table = $rs_line->sql; 
    4941 
    5042        $query = "PRAGMA table_info(". sqlite_escape_string($tableName) .")"; 
    5143        $rs = $this->_connector->query($query); 
     44        while ($line = $rs->fetch()) { 
     45            $field = new jDbFieldProperties(); 
     46            $field->name = $line->name; 
     47            $field->primary  = ($line->pk == 1); 
     48            $field->notNull   = ($line->notnull == '99' || $line->pk == 1); 
    5249 
    53         while ($result_line = $rs->fetch()){ 
    54             $field = new jDbFieldProperties(); 
     50            if (preg_match('/^(\w+)\s*(\((\d+)\))?.*$/',$line->type,$m)) { 
     51                $field->type = strtolower($m[1]); 
     52                if (isset($m[3])) { 
     53                    $field->length = intval($m[3]); 
     54                } 
     55            } 
     56            else { 
     57                $field->type = $line->type; 
     58            } 
    5559 
    56             $type = $result_line->type; 
    57  
    58             /** 
    59             * récupéré depuis phpMyAdmin 
    60             */ 
    61             // set or enum types: slashes single quotes inside options 
    62             $type   = str_replace('BINARY', '', $type); 
    63             $type   = str_replace('ZEROFILL', '', $type); 
    64             $type   = str_replace('UNSIGNED', '', $type); 
    65             /* 
    66             if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)){ 
    67                 $type   = $tmp[1]; 
    68                 $length = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1); 
    69             }else{ 
    70                 $length = $type; 
    71                 $type   = chop(eregi_replace('\\(.*\\)', '', $type)); 
    72                 if (!empty($type)){ 
    73                     $length = eregi_replace("^$type\(", '', $length); 
    74                     $length = eregi_replace('\)$', '', trim($length)); 
     60            if ($field->type == 'integer' && $field->primary) { 
     61                $field->autoIncrement = true; 
     62            } 
     63            if (!$field->primary) { 
     64                if ($line->dflt_value !== null || ($line->dflt_value === null && !$field->notNull)) { 
     65                    $field->hasDefault = true; 
     66                    $field->default =  $line->dflt_value; 
    7567                } 
    76                 if ($length == $type){ 
    77                     $length = ''; 
    78                 } 
    79             }*/ 
    80  
    81             preg_match('/^(\w+).*$/',$type,$m); 
    82  
    83             $field->type      = strtolower($m[1]); 
    84             $field->name = $result_line->name; 
    85             //$p_result_line->length    = $length; 
    86             $field->notNull   = ($result_line->notnull != 1); 
    87             $field->primary  = ($result_line->pk == 1); 
    88  
    89             if (preg_match('/^int/i', $field->type)) { 
    90                 if ($field->primary) { 
    91                     $field->autoIncrement = true; 
    92                 } else { 
    93                     $str = stristr($create_table, $field->name); 
    94                     $array = explode(',', $str); 
    95                     if (preg_match('/autoincrement/i', $array[0])) { 
    96                         $field->autoIncrement = true; 
    97                     } else { 
    98                         $field->autoIncrement = false; 
    99                     } 
    100                 } 
    101             } else { 
    102                 $field->autoIncrement = false; 
    10368            } 
    104             $results[$result_line->name] = $field; 
     69            $results[$line->name] = $field; 
    10570        } 
    10671        return $results; 
  • trunk/lib/jelix/plugins/db/sqlite/sqlite.dbtools.php

    r639 r640  
    44* @subpackage db_driver 
    55* @author     Loic Mathaud 
    6 * @contributor 
    7 * @copyright  2006 Loic Mathaud 
     6* @contributor Laurent Jouanneau 
     7* @copyright  2006 Loic Mathaud, 2007 Laurent Jouanneau 
    88* @link      http://www.jelix.org 
    99* @licence  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    1616 */ 
    1717class sqliteDbTools extends jDbTools { 
    18     function __construct($connector){ 
    19         parent::__construct($connector); 
    20     } 
    2118 
    2219    /** 
     
    2421    * @return   array    $tab[] = $nomDeTable 
    2522    */ 
    26     function _getTableList (){ 
     23    protected function _getTableList (){ 
    2724        $results = array (); 
    2825 
     
    4037    * @return   array    $tab[NomDuChamp] = obj avec prop (tye, length, lengthVar, notnull) 
    4138    */ 
    42     function _getFieldList ($tableName)
     39    protected function _getFieldList ($tableName)
    4340        $results = array (); 
    44  
    45         $query = "SELECT sql FROM sqlite_master WHERE tbl_name= '". $tableName ."'"; 
    46         $rs = $this->_connector->query($query); 
    47         $rs_line = $rs->fetch(); 
    48         $create_table = $rs_line->sql; 
    4941 
    5042        $query = "PRAGMA table_info(". sqlite_escape_string($tableName) .")"; 
    5143        $rs = $this->_connector->query($query); 
     44        while ($line = $rs->fetch()) { 
     45            $field = new jDbFieldProperties(); 
     46            $field->name = $line->name; 
     47            $field->primary  = ($line->pk == 1); 
     48            $field->notNull   = ($line->notnull == '99' || $line->pk == 1); 
    5249 
    53         while ($result_line = $rs->fetch()){ 
    54             $field = new jDbFieldProperties(); 
     50            if (preg_match('/^(\w+)\s*(\((\d+)\))?.*$/',$line->type,$m)) { 
     51                $field->type = strtolower($m[1]); 
     52                if (isset($m[3])) { 
     53                    $field->length = intval($m[3]); 
     54                } 
     55            } 
     56            else { 
     57                $field->type = $line->type; 
     58            } 
    5559 
    56             $type = $result_line->type; 
    57  
    58             /** 
    59             * récupéré depuis phpMyAdmin 
    60             */ 
    61             // set or enum types: slashes single quotes inside options 
    62             $type   = str_replace('BINARY', '', $type); 
    63             $type   = str_replace('ZEROFILL', '', $type); 
    64             $type   = str_replace('UNSIGNED', '', $type); 
    65             /* 
    66             if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)){ 
    67                 $type   = $tmp[1]; 
    68                 $length = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1); 
    69             }else{ 
    70                 $length = $type; 
    71                 $type   = chop(eregi_replace('\\(.*\\)', '', $type)); 
    72                 if (!empty($type)){ 
    73                     $length = eregi_replace("^$type\(", '', $length); 
    74                     $length = eregi_replace('\)$', '', trim($length)); 
     60            if ($field->type == 'integer' && $field->primary) { 
     61                $field->autoIncrement = true; 
     62            } 
     63            if (!$field->primary) { 
     64                if ($line->dflt_value !== null || ($line->dflt_value === null && !$field->notNull)) { 
     65                    $field->hasDefault = true; 
     66                    $field->default =  $line->dflt_value; 
    7567                } 
    76                 if ($length == $type){ 
    77                     $length = ''; 
    78                 } 
    79             }*/ 
    80  
    81             preg_match('/^(\w+).*$/',$type,$m); 
    82  
    83             $field->type      = strtolower($m[1]); 
    84             $field->name = $result_line->name; 
    85             //$p_result_line->length    = $length; 
    86             $field->notNull   = ($result_line->notnull != 1); 
    87             $field->primary  = ($result_line->pk == 1); 
    88  
    89             if (preg_match('/^int/i', $field->type)) { 
    90                 if ($field->primary) { 
    91                     $field->autoIncrement = true; 
    92                 } else { 
    93                     $str = stristr($create_table, $field->name); 
    94                     $array = explode(',', $str); 
    95                     if (preg_match('/autoincrement/i', $array[0])) { 
    96                         $field->autoIncrement = true; 
    97                     } else { 
    98                         $field->autoIncrement = false; 
    99                     } 
    100                 } 
    101             } else { 
    102                 $field->autoIncrement = false; 
    10368            } 
    104             $results[$result_line->name] = $field; 
     69            $results[$line->name] = $field; 
    10570        } 
    10671        return $results; 
  • trunk/testapp/modules/jelix_tests/daos/products.dao.xml

    r628 r640  
    77      <property name="id"   fieldname="id" datatype="autoincrement"/> 
    88      <property name="name" fieldname="name" datatype="string"  required="true"/> 
    9       <property name="price" fieldname="price" datatype="float"/> 
     9      <property name="price" fieldname="price" datatype="float" default="0"/> 
    1010      <property name="create_date" fieldname="create_date" datatype="datetime" insertpattern="NOW()"/> 
    1111   </record> 
  • trunk/testapp/modules/jelix_tests/daos/products.dao.xml

    r628 r640  
    77      <property name="id"   fieldname="id" datatype="autoincrement"/> 
    88      <property name="name" fieldname="name" datatype="string"  required="true"/> 
    9       <property name="price" fieldname="price" datatype="float"/> 
     9      <property name="price" fieldname="price" datatype="float" default="0"/> 
    1010      <property name="create_date" fieldname="create_date" datatype="datetime" insertpattern="NOW()"/> 
    1111   </record> 
  • trunk/testapp/modules/jelix_tests/tests/jdao.parser.html.php

    r584 r640  
    340340            <null p="maxlength"/> 
    341341            <null p="minlength"/> 
     342            <null p="defaultValue" /> 
     343            <boolean p="ofPrimaryTable" value="true" /> 
     344        </object>' 
     345        ), 
     346        array( 
     347        '<?xml version="1.0"?> 
     348        <property name="label" datatype="string" default="no label"/>', 
     349        '<?xml version="1.0"?> 
     350        <object> 
     351            <string p="name" value="label"/> 
     352            <string p="fieldName" value="label"/> 
     353            <string p="table" value="news"/> 
     354            <string p="datatype" value="string"/> 
     355            <null p="regExp"/> 
     356            <boolean p="required" value="false"/> 
     357            <boolean p="requiredInConditions" value="false"/> 
     358            <boolean p="isPK" value="false" /> 
     359            <boolean p="isFK" value="false" /> 
     360            <string p="updatePattern" value="%s" /> 
     361            <string p="insertPattern" value="%s" /> 
     362            <string p="selectPattern" value="%s" /> 
     363            <string p="sequenceName" value="" /> 
     364            <null p="maxlength"/> 
     365            <null p="minlength"/> 
     366            <string p="defaultValue" value="no label" /> 
    342367            <boolean p="ofPrimaryTable" value="true" /> 
    343368        </object>' 
  • trunk/testapp/modules/jelix_tests/tests/jdao.parser.html.php

    r584 r640  
    340340            <null p="maxlength"/> 
    341341            <null p="minlength"/> 
     342            <null p="defaultValue" /> 
     343            <boolean p="ofPrimaryTable" value="true" /> 
     344        </object>' 
     345        ), 
     346        array( 
     347        '<?xml version="1.0"?> 
     348        <property name="label" datatype="string" default="no label"/>', 
     349        '<?xml version="1.0"?> 
     350        <object> 
     351            <string p="name" value="label"/> 
     352            <string p="fieldName" value="label"/> 
     353            <string p="table" value="news"/> 
     354            <string p="datatype" value="string"/> 
     355            <null p="regExp"/> 
     356            <boolean p="required" value="false"/> 
     357            <boolean p="requiredInConditions" value="false"/> 
     358            <boolean p="isPK" value="false" /> 
     359            <boolean p="isFK" value="false" /> 
     360            <string p="updatePattern" value="%s" /> 
     361            <string p="insertPattern" value="%s" /> 
     362            <string p="selectPattern" value="%s" /> 
     363            <string p="sequenceName" value="" /> 
     364            <null p="maxlength"/> 
     365            <null p="minlength"/> 
     366            <string p="defaultValue" value="no label" /> 
    342367            <boolean p="ofPrimaryTable" value="true" /> 
    343368        </object>' 
  • trunk/testapp/modules/jelix_tests/tests/jdb.1_queries.html.php

    r639 r640  
    127127        <boolean property="hasDefault" value="false" /> 
    128128        <null property="default" /> 
     129        <integer property="length" value="0" /> 
    129130    </object> 
    130131    <object key="name" class="jDbFieldProperties"> 
     
    136137        <boolean property="hasDefault" value="false" /> 
    137138        <string property="default" value="" /> 
     139        <integer property="length" value="150" /> 
    138140    </object> 
    139141    <object key="price" class="jDbFieldProperties"> 
     
    145147        <boolean property="hasDefault" value="true" /> 
    146148        <string property="default" value="0" /> 
     149        <integer property="length" value="0" /> 
    147150    </object> 
    148151</array>'; 
  • trunk/testapp/modules/jelix_tests/tests/jdb.1_queries.html.php

    r639 r640  
    127127        <boolean property="hasDefault" value="false" /> 
    128128        <null property="default" /> 
     129        <integer property="length" value="0" /> 
    129130    </object> 
    130131    <object key="name" class="jDbFieldProperties"> 
     
    136137        <boolean property="hasDefault" value="false" /> 
    137138        <string property="default" value="" /> 
     139        <integer property="length" value="150" /> 
    138140    </object> 
    139141    <object key="price" class="jDbFieldProperties"> 
     
    145147        <boolean property="hasDefault" value="true" /> 
    146148        <string property="default" value="0" /> 
     149        <integer property="length" value="0" /> 
    147150    </object> 
    148151</array>'; 
  • trunk/testapp/modules/jelix_tests/tests/jdb.pgsql.html.php

    r639 r640  
    3131        <boolean property="hasDefault" value="true" /> 
    3232        <string property="default" value="" /> 
     33        <integer property="length" value="0" /> 
    3334    </object> 
    3435    <object key="name" class="jDbFieldProperties"> 
     
    4041        <boolean property="hasDefault" value="false" /> 
    4142        <null property="default" /> 
     43        <integer property="length" value="150" /> 
    4244    </object> 
    4345    <object key="price" class="jDbFieldProperties"> 
     
    4951        <boolean property="hasDefault" value="true" /> 
    5052        <string property="default" value="0" /> 
     53        <integer property="length" value="0" /> 
    5154    </object> 
    5255</array>'; 
  • trunk/testapp/modules/jelix_tests/tests/jdb.pgsql.html.php