Visual Paradigm Logo
     Build Quality Applications Faster, Better and Cheaper
 
Home | Products | Download | Documentation | Support | Resources | Partners | Quick Tour | Shop | Company |  
 
   Visual Paradigm Discussion Forum
  Login   [ Register ] Email: Password: Log me on automatically I lost my password  
Recent Topics
Advanced Search
Bug in PHP code generation  
Forum Index -> DB Visual ARCHITECT (DB-VA)
Author Message
rbegga


Joined: 2007/11/14
Messages: 8

Offline

I noticed that if I create an entity with a composite key, the loadByORMID method that is automatically generated contains a bug:

Code:
   
 public static function loadUserByORMID($name, $company) {
     $m = epManager :: instance();
     $user = $m->create('User');
     $user->name = $name;
     $users = $m->find($user);
     $userValues = array_values($users);
     return $userValues[0];
     $user->company = $company;
     $users = $m->find($user);
     $userValues = array_values($users);
     return $userValues[0];
   } 


As you can see the function signature correctly contains both pieces of the composite key. However, the code generator in DBVA is trying to perform two separate searches, one for each half of the key when in fact it should be searching for both halves at the same time as in the following example which I coded by hand:

Code:
   public static function loadUserByORMID($name, $company) {
     $m = epManager :: instance();
     $user = $m->create('User');
     $user->name = $name;
     $user->company = $company;
     $users = $m->find($user);
     $userValues = array_values($users);
     return $userValues[0];
   } 


Any idea how long this might take to fix?
 
Jick


Joined: 2005/04/29
Messages: 2880

Offline

Hello rbegga,

I'll talk to our engineers and answer your qusetion asap.

Best regards,
Jick

Visual Paradigm International Ltd.
http://www.visual-paradigm.com

Build Quality Applications Faster, Better and Cheaper
 
rbegga


Joined: 2007/11/14
Messages: 8

Offline

Jick,

Thanks for looking into this I really appreciate it. Also, I am not sure if you saw my other post regarding transactions in PHP but I'm hoping maybe engineering has an idea there as well? I really need to be able to use transactions in my applicaitons.

-TJ
 
Jick


Joined: 2005/04/29
Messages: 2880

Offline

Hi rbegga,

This is a bug. We will fix it and send you a patch tomorrow.

Best regards,
Jick

Visual Paradigm International Ltd.
http://www.visual-paradigm.com

Build Quality Applications Faster, Better and Cheaper
 
Jick


Joined: 2005/04/29
Messages: 2880

Offline

Hello rbegga,

Sorry for my late reply. This is the download URL of the patch:
http://files3.visual-paradigm.com/200711/Patch/sp1_20071119j/VP_Suite_Windows_3_1_sp1_20071119j.exe

Please try it out.

Best regards,
Jick

Visual Paradigm International Ltd.
http://www.visual-paradigm.com

Build Quality Applications Faster, Better and Cheaper
 
rbegga


Joined: 2007/11/14
Messages: 8

Offline

Jick,

I need the patch to be for the MacOS X version of DBVA to test it out. Sorry I forgot to mention that again.

Thanks!

-TJ
 
Rain


Joined: 2005/04/29
Messages: 735

Offline

Hello rbegga,

Please find the Mac version at
http://files3.visual-paradigm.com/200711/Patch/sp1_20071119k/VP_Suite_MacOSX_3_1_sp1_20071119k.dmg

Best regards,
Rain
 
rbegga


Joined: 2007/11/14
Messages: 8

Offline

That fix seems to have worked. Thanks!

-TJ
 
 
   Forum Index -> DB Visual ARCHITECT (DB-VA)
Go to:   
Powered by JForum 2.1.4 © 2005 - Rafael Steil