$B$&$($d$^$G$9!#(B<br><br>$B:G6a!"$R$5$7$V$j$K(BS2Dao$B$G%W%m%0%i%`$r:n@.$7$@$7$^$7$?!#(B<br>$B$G!"$"$k%F!<%V%kMQ$N(BDao$B$H(BEntity$B$r:n@.$7$F(BDao$B$N(BfindAllArray$B$r(B<br>$B<B9T$9$k$H0J2<$N%(%i!<$,H/@8$7$^$7$?!#(B<br><br>$B$I$&$b!"(Bs2dao.core.classes.php$B$N(BcheckPrimaryKey()$B<B9T;~$K(BPK$B$,(B<br>$BDj5A$5$l$F$$$J$$$HH=CG$5$l$F%(%i!<$H$J$C$F$$$k$h$&$G$9!#(B<br>create table$BJ8$r8+$k8B$j(BPK$B@_Dj$7$F$$$^$9$7!&!&!&(B
<br><br>$B$3$l$+$iD4$Y$F$$$/$D$b$j$G$9$,!"2a5n$KF1$8$h$&$J$3$H$,5/$3$C$?$J$I(B<br>$B;29M$K$J$k$h$&$J>pJs$,$"$j$^$7$?$i65$($F$$$?$@$1$J$$$G$7$g$&$+!)(B<br><br>$B%F!<%V%kDj5A$,@5$7$$!J(BPK$BDj5A:Q$_!K$H$7$F!"(B$bmd->getPrimaryKeySize() == 0$B$H$J$k>u67$O(B<br>$B$I$N$h$&$JIT6q9g$,A[Dj$5$l$k$G$7$g$&$+!)!)(B<br><br><br>$B0J>e$G$9!#2?$i$+$NBP1~$r$7$F$$$?$@$1$?$i$"$j$,$?$$$G$9!#(B<br><br>S2Container$B$*$h$S(BS2Dao$B$O:G?7$r;HMQ$7$F$$$^$9!#(B
<br><br><br>--------------------------------$B0J2<!";29M>pJs(B-------------<br>$B#1!%H/@8$7$?%(%i!<(B<br><br>S2Dao_PrimaryKeyNotFoundRuntimeException<br>Description<br><br>PrimaryKey not found in UsersEntity<br>Source File<br><br>/Users/webadmin/lib/S2Dao/build/s2dao.php5/s2dao.core.classes.php (933)
<br><br>0922: protected function setupDeleteSql() {<br>0923: $this->checkPrimaryKey();<br>0924: $buf = '';<br>0925: $buf .= 'DELETE FROM ';<br>0926: $buf .= $this->getBeanMetaData()->getTableName();
<br>0927: $this->setupUpdateWhere($buf);<br>0928: $this->setSql($buf);<br>0929: }<br>0930: protected function checkPrimaryKey() {<br>0931: $bmd = $this->getBeanMetaData();<br>0932: if ($bmd->getPrimaryKeySize() == 0) {
<br>0933: throw new S2Dao_PrimaryKeyNotFoundRuntimeException($bmd->getBeanClass());<br>0934: }<br>0935: }<br>0936: protected function setupUpdateWhere(&$buf) {<br>0937: $bmd = $this->getBeanMetaData();
<br>0938: $buf .= ' WHERE ';<br>0939: for ($i = 0; $i < $bmd->getPrimaryKeySize(); ++$i) {<br>0940: $buf .= $bmd->getPrimaryKey($i);<br>0941: $buf .= ' = ? AND ';
<br>0942: }<br>0943: $buf = preg_replace('/( AND )$/', '', $buf);<br>0944: if ($bmd->hasVersionNoPropertyType()) {<br>0945: $pt = $bmd->getVersionNoPropertyType();
<br><br><br>Stack Trace<br><br>#0 /Users/webadmin/lib/S2Dao/build/s2dao.php5/s2dao.core.classes.php(907): S2Dao_AbstractAutoStaticCommand->checkPrimaryKey()<br>#1 /Users/webadmin/lib/S2Dao/build/s2dao.php5/S2Dao/S2Dao_UpdateAutoStaticCommand.class.php(47): S2Dao_AbstractAutoStaticCommand->setupUpdateSql()
<br>#2 /Users/webadmin/lib/S2Dao/build/s2dao.php5/s2dao.core.classes.php(840): S2Dao_UpdateAutoStaticCommand->setupSql()<br>#3 /Users/webadmin/lib/S2Dao/build/s2dao.php5/S2Dao/S2Dao_UpdateAutoStaticCommand.class.php(35): S2Dao_AbstractAutoStaticCommand->__construct(Object(S2Container_PDODataSource), Object(S2Dao_BasicStatementFactory), Object(S2Dao_BeanMetaDataImpl), Array)
<br>#4 /Users/webadmin/lib/S2Dao/build/s2dao.php5/S2Dao/S2Dao_DaoMetaDataImpl.class.php(235): S2Dao_UpdateAutoStaticCommand->__construct(Object(S2Container_PDODataSource), Object(S2Dao_BasicStatementFactory), Object(S2Dao_BeanMetaDataImpl), Array)
<br>#5 /Users/webadmin/lib/S2Dao/build/s2dao.php5/S2Dao/S2Dao_DaoMetaDataImpl.class.php(182): S2Dao_DaoMetaDataImpl->setupUpdateMethodByAuto(Object(ReflectionMethod))<br>#6 /Users/webadmin/lib/S2Dao/build/s2dao.php5/S2Dao/S2Dao_DaoMetaDataImpl.class.php(105): S2Dao_DaoMetaDataImpl->setupMethodByAuto(Object(ReflectionMethod))
<br>#7 /Users/webadmin/lib/S2Dao/build/s2dao.php5/S2Dao/S2Dao_DaoMetaDataImpl.class.php(87): S2Dao_DaoMetaDataImpl->setupMethod(Object(ReflectionMethod))<br>#8 /Users/webadmin/lib/S2Dao/build/s2dao.php5/S2Dao/S2Dao_DaoMetaDataImpl.class.php(77): S2Dao_DaoMetaDataImpl->setupSqlCommand()
<br>#9 /Users/webadmin/lib/S2Dao/build/s2dao.php5/s2dao.core.classes.php(1461): S2Dao_DaoMetaDataImpl->__construct(Object(ReflectionClass), Object(S2Container_PDODataSource), Object(S2Dao_BasicStatementFactory), Object(S2Dao_BasicResultSetFactory), Object(S2Dao_FieldAnnotationReaderFactory))
<br>#10 /Users/webadmin/lib/S2Dao/build/s2dao.php5/s2dao.core.classes.php(1505): S2Dao_DaoMetaDataFactoryImpl->getDaoMetaData(Object(ReflectionClass))<br>#11 /Users/webadmin/lib/S2Container/build/s2container.php5/s2container.core.classes.php(3056): S2DaoInterceptor->invoke(Object(S2Container_S2MethodInvocationImpl))
<br>#12 /Users/webadmin/lib/S2Container/build/s2container.php5/S2Container/S2Container_AopProxyGenerator.class.php(83) : eval()'d code(24): S2Container_S2MethodInvocationImpl->proceed()<br>#13 /Users/webadmin/lib/S2Container/build/s2container.php5/S2Container/S2Container_AopProxyGenerator.class.php(83) : eval()'d code(45): UserDaoEnhancedByS2AOP->__call('findAllArray', Array)
<br>#14 /Users/webadmin/public_html/s2prado/protected/logic/UserLogicImpl.class.php(18): UserDaoEnhancedByS2AOP->findAllArray()<br>#15 /Users/webadmin/public_html/s2prado/protected/pages/UserGrid.class.php(14): UserLogicImpl->findAllArray()
<br>#16 /Users/webadmin/lib/s2prado/prado/framework/TComponent.php(102): UserGrid->getData()<br>#17 /Users/webadmin/lib/s2prado/prado/framework/Web/UI/TControl.php(204): TComponent->__get('Data')<br>#18 /Users/webadmin/public_html/s2prado/protected/pages/UserGrid.class.php(32): TControl->__get('Data')
<br>#19 /Users/webadmin/lib/s2prado/prado/framework/Web/UI/TControl.php(1286): UserGrid->onLoad(NULL)<br>#20 /Users/webadmin/lib/s2prado/prado/framework/Web/UI/TPage.php(210): TControl->loadRecursive()<br>#21 /Users/webadmin/lib/s2prado/prado/framework/Web/UI/TPage.php(193): TPage->processNormalRequest(Object(THtmlWriter))
<br>#22 /Users/webadmin/lib/s2prado/Teeda/Web/Services/SPageService.php(108): TPage->run(Object(THtmlWriter))<br>#23 /Users/webadmin/lib/s2prado/Teeda/Web/Services/SPageService.php(96): SPageService->runPage(Object(UserGrid), Array)
<br>#24 /Users/webadmin/lib/s2prado/prado/framework/TApplication.php(1066): SPageService->run()<br>#25 /Users/webadmin/lib/s2prado/prado/framework/TApplication.php(376): TApplication->runService()<br>#26 /Users/webadmin/public_html/s2prado/index.php(29): TApplication->run()
<br>#27 {main}<br><br><br>$B#2!%BP>]$N%F!<%V%k(B<br><br>CREATE TABLE `users` (<br> `id` int(10) unsigned NOT NULL auto_increment,<br> `name` varchar(50) default NULL,<br> `email` varchar(255) character set utf8 collate utf8_bin NOT NULL default '',
<br> `pwd` varchar(255) default NULL,<br> `profile` text,<br> `created` datetime default NULL,<br> `modified` datetime default NULL,<br> PRIMARY KEY (`id`),<br> UNIQUE KEY `email` (`email`)<br>) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
<br><br>$B#3!%BP>]$N%(%s%F%#%F%#%/%i%9(B<br><br><?php<br>class UsersEntity {<br> const TABLE = "users";<br> public function __construct(){}<br><br> protected $id;<br> const id_COLUMN = "id";<br> public function setId($val){$this->id = $val;}
<br> public function getId(){return $this->id;}<br><br> protected $name;<br> const name_COLUMN = "name";<br> public function setName($val){$this->name = $val;}<br> public function getName(){return $this->name;}
<br><br> protected $email;<br> const email_COLUMN = "email";<br> public function setEmail($val){$this->email = $val;}<br> public function getEmail(){return $this->email;}<br><br> protected $pwd;
<br> const pwd_COLUMN = "pwd";<br> public function setPwd($val){$this->pwd = $val;}<br> public function getPwd(){return $this->pwd;}<br><br> protected $profile;<br> const profile_COLUMN = "profile";
<br> public function setProfile($val){$this->profile = $val;}<br> public function getProfile(){return $this->profile;}<br><br> protected $created;<br> const created_COLUMN = "created";<br> public function setCreated($val){$this->created = $val;}
<br> public function getCreated(){return $this->created;}<br><br> protected $modified;<br> const modified_COLUMN = "modified";<br> public function setModified($val){$this->modified = $val;}<br>
public function getModified(){return $this->modified;}<br><br><br> public function __toString() {<br> $buf = array();<br> $buf[] = 'id => ' . $this->getId();<br> $buf[] = 'name => ' . $this->getName();
<br> $buf[] = 'email => ' . $this->getEmail();<br> $buf[] = 'pwd => ' . $this->getPwd();<br> $buf[] = 'profile => ' . $this->getProfile();<br> $buf[] = 'created => ' . $this->getCreated();
<br> $buf[] = 'modified => ' . $this->getModified();<br> return '{' . implode(', ',$buf) . '}';<br> }<br><br><br> /*<br> private $prop;<br> const prop_RELNO = 0;
<br> const prop_RELKEYS = 'this_fk:other_pk';<br> public function setProp(OtherEntity $entity){ $this->prop = $entity; }<br> public function getProp(){ return $this->prop; }<br> */<br>}<br><br>$B#4!%BP>]$N(BDao
<br><?php<br>interface UserDao {<br> const BEAN = "UsersEntity";<br> <br> public function findAllList();<br> public function findAllArray();<br> public function update(UsersEntity $entity);<br>
public function insert(UsersEntity $entity);<br> public function delete(UsersEntity $entity);<br>}<br>?><br><br>$B0J>e$G$9!#(B<br>-- <br>------------------------------------------------------------------<br> $B?";3!!G=@.(B@$BJ!2,(B<br>
$B!!(Bmailto:<a href="mailto:ueyama@gmail.com">ueyama@gmail.com</a><br>------------------------------------------------------------------<br>