blaiselnelson / db2php Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/db2php
License: GNU General Public License v3.0
Automatically exported from code.google.com/p/db2php
License: GNU General Public License v3.0
Gostaria de saber como faço para fazer select personalizada exemplo:
select count(o) from MinhaClass o where o.nome like '%x%'
Original issue reported on code.google.com by [email protected]
on 16 Jul 2009 at 12:22
Add method in the PHP code which the value gets passed through before
beeing assigned to allow handling special types which don't have a
__toString().
Original issue reported on code.google.com by [email protected]
on 2 Jul 2009 at 9:19
Create a table with columns like this:
Pk
Name1
Name_1
I expected Name1 and Name_1 to be treated as separate columns, but while the
constants distinguish between them, the setter methods are both named setName1.
(Not: setName1 and setName_1)
This causes errors such as:
Cannot redeclare MyModel::setName1() ...
Obviously, changing the column names would fix this, but I need to use the
database as it is, not as I wish it could be.
Windows 7, NetBeans IDE 7.0.1 (Build 201107282000)
DB2PHP Version: 1.3
Original issue reported on code.google.com by [email protected]
on 23 Mar 2012 at 11:20
If modification tracking is enabled and old instance is available use
those values for identifiers, to enable updating with modified
identifiers.
Original issue reported on code.google.com by [email protected]
on 3 Jul 2009 at 6:59
i have reveiewed the issues found to fix some errors of db2php but i finally
got this exception :
Fatal error: Uncaught exception 'Exception' with message '00000:array ( 0 =>
'00000', 1 => 1064, 2 => 'You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax to
use near \'"categories"\' at line 1', )' in C:\Program Files\Apache Software
Foundation\Apache HTTP
Server\htdocs\db2php\models\CategoriesModel.class.php:448 Stack trace: #0
C:\Program Files\Apache Software Foundation\Apache HTTP
Server\htdocs\db2php\models\CategoriesModel.class.php(435):
CategoriesModel::fromStatement(Object(PDOStatement)) #1 C:\Program Files\Apache
Software Foundation\Apache HTTP
Server\htdocs\db2php\models\CategoriesModel.class.php(408):
CategoriesModel::findByFilter(Object(PDO), Array, true, NULL) #2 C:\Program
Files\Apache Software Foundation\Apache HTTP
Server\htdocs\db2php\index.php(27): CategoriesModel::findByExample(Object(PDO),
Object(CategoriesModel)) #3 {main} thrown in C:\Program Files\Apache Software
Foundation\Apache HTTP Server\htdocs\db2php\models\CategoriesModel.class.php on
line 448
to run the following snippet :
<?php
require_once 'helpers/Db2PhpEntity.class.php';
require_once 'helpers/Db2PhpEntityBase.class.php';
require_once 'helpers/Db2PhpEntityModificationTracking.class.php';
require_once 'helpers/DFCAggregate.class.php';
require_once 'helpers/DSC.class.php';
require_once 'helpers/DFC.class.php';
require_once 'helpers/DSC.class.php';
require_once 'models/CategoriesModel.class.php';
$db=new PDO('mysql:dbname=pfe;host=localhost', 'root', 'mrad');
// query all categories with dexterity=12 and reasoning=4 (query by example
currently only available for PDO!)
$categories=new CategoriesModel();
//$example->setDexterity(12)->setReasoning(4);
foreach (CategoriesModel::findByExample($db, $categories) as $catergory) {
echo $catergory->getId() . ':' . $catergory->getLabel() . "\n";
}
?>
can you help me fix it ? i could not be able to show the categories available
in database on page ...
Original issue reported on code.google.com by [email protected]
on 2 May 2013 at 12:11
What steps will reproduce the problem?
1. Connected to my workspace in oracle.
2. connection succeeded.
3. retrieving tables (when saying "Please wait ...") is taking so long time
(more than 15 minutes)
What is the expected output? What do you see instead?
expecting to see the tables in my workspace and waiting and waiting and all I
see is "Please wait ..."
What version of the product are you using? On what operating system?
V. 1.2 on Windows 32bit with netbeans 7.3.1
thank you.
Original issue reported on code.google.com by [email protected]
on 30 Oct 2013 at 1:45
Hi, don't know if you're still working on this project. I hope so, because
this is already a great plug-in and it has huge potential. I couldn't see
another way of contacting you, so I decided to post my suggestions here.
It would be nice if all the generated entity classes had a common abstract
base class. Loads of the methods can be implemented in this base class,
since they do not differ from class to class. Other methods could be
declared abstract, since all the generated classes have this method, but
they use a different implementation.
I think this would be a much cleaner implementation of the generated
classes. It would have many benefits. If I decide to modify an existing
method, I wouldn't have to modify every generated class (or the source
code that generates these classes). Changes can be made in one place.
Also, functions and methods can be reused for every generated class
without resorting to ugly and unsafe casting methods.
Original issue reported on code.google.com by [email protected]
on 18 Nov 2009 at 10:53
Implement sorting.
Original issue reported on code.google.com by [email protected]
on 3 Aug 2009 at 6:30
When using updateToDatabase i have an error because pk can't be updated on sql
server.
I can fix this just changing the update clause on generated class, the problem
is that each time i want to regenerate the class, i have to the same, is any
solution for this?
Original issue reported on code.google.com by [email protected]
on 19 Dec 2011 at 10:12
What steps will reproduce the problem?
1.create a table with a pk
2.generate model
3.try to change the pk value with updateToDatabase(PDO $db)
What is the expected output? What do you see instead?
a modified row with the new pk value
What version of the product are you using? On what operating system?
1.2.6.3
Windows 7
NetBeans 6.8
Please provide any additional information below.
I've found the error in this code:
public function updateToDatabase(PDO $db) {
$stmt=self::prepareStatement($db,self::SQL_UPDATE);
$this->bindValues($stmt);
$stmt->bindValue(4,$this->getName());
$affected=$stmt->execute();
In case the pk value has changed, should use $this->OldInstance->getName(),
since $this->getName() contains the new value.
Original issue reported on code.google.com by [email protected]
on 19 Apr 2010 at 1:15
Hi,
I've ran into this small bug a couple of times. I'll leave the bug
template and fill in the fields. I hope you'll get back to the project
some day, I still think this is a great plugin.
What steps will reproduce the problem?
1. Generate the objects for a database as normal
2. Delete all the generated DB2PHP objects
3. Try to generate the objects again
What is the expected output? What do you see instead?
You'd expect to be able to generate the objects again, but the plugin
can't connect to the database, it says "No tables found". Other databases
work fine, but I have to restart Netbeans to get it to work for the first
database.
What version of the product are you using? On what operating system?
Latest version of DB2PHP, first Netbeans 6.7 and now 6.8. Windows Vista 32-
bit.
Please provide any additional information below.
I am using MySQL databases.
Original issue reported on code.google.com by [email protected]
on 3 Mar 2010 at 1:04
It happens if the projet is not in a local workspace. (on a network as an
exemple)
The message is shown right after the tables are selected.
Original issue reported on code.google.com by [email protected]
on 12 Jun 2014 at 8:15
meeh ... ppl actually use whitespaces in field names :O
Original issue reported on code.google.com by [email protected]
on 29 Jun 2009 at 7:50
it does not work for me , i tried the example and the same errors occurs , the
following exception is displayed :
Fatal error: Uncaught exception 'Exception' with message '00000:array ( 0 =>
'00000', 1 => 1046, 2 => 'No database selected', )' in C:\Program Files\Apache
Software Foundation\Apache HTTP
Server\htdocs\example\ProductModel.class.php:749 Stack trace: #0 C:\Program
Files\Apache Software Foundation\Apache HTTP
Server\htdocs\example\index.php(19): ProductModel::findById(Object(PDO),
948933) #1 {main} thrown in C:\Program Files\Apache Software Foundation\Apache
HTTP Server\htdocs\example\ProductModel.class.php on line 749
i checked the generated helpers and the models and i found that it need more
development because some errors are fixed in these php classes ...
the db2php version i used is : the v1.3 and v1.07 ...
please update !!!!!!!!!!!!!!
Original issue reported on code.google.com by [email protected]
on 18 Apr 2013 at 4:50
Hi,
I generated models of the mysql database, but when I use the generated model
gives the following errors:
Call to undefined method ModelCategorias::notifyChanged()
PHP Fatal error: Class 'Db2PhpEntityBase' not found
Help me, thanks =)
Paulo Roberto Silva
[email protected]
Original issue reported on code.google.com by [email protected]
on 15 Mar 2012 at 7:14
How about using transactions with PDO.
It would be nice to have. Example can be found here
http://php.net/manual/en/pdo.transactions.php
Original issue reported on code.google.com by [email protected]
on 31 Jul 2012 at 8:11
I succeed to try to insert some data to my database , and update some data and
delete others with db2php library , however , my question is : is it possible
to return the status of each CRUD operation in case it succeeds it must return
a FLAG or something like a BOOLEAN variable to check and display a confirmation
message to the final user or an error when it fails ...
Does this library covers opeation status ?
Original issue reported on code.google.com by [email protected]
on 22 Apr 2013 at 12:09
In DFCAggregate.class.php on line 183 there is a variable $i used which is not
defined
Original issue reported on code.google.com by [email protected]
on 7 Oct 2014 at 9:40
Hi
I downloaded netbeans from
https://netbeans.org/downloads/start.html?platform=windows&lang=en&option=all
Downloaded the db2php files from
https://code.google.com/p/db2php/downloads/detail?name=db2phpcli-bin-1.107.jar
https://code.google.com/p/db2php/downloads/detail?name=db2phpnb-1.107.nbm
Now what do I do? No documentation anywhere?
Loading the files into NetBeans just gives a list of files. What do I next?
Original issue reported on code.google.com by [email protected]
on 17 Jul 2015 at 1:16
Attachments:
Valid table field != valid PHP identifier :O
Original issue reported on code.google.com by [email protected]
on 29 Jun 2009 at 7:52
You discourage modifying the generated classes, since if you have to
generate them again the changes will be lost. However, if I create a class
that extends a generated class I'd have to modify the return types of the
generated class to the extended type for it to be of any use.
Say I generated a class of a products table, called PHP2DB_Products. Then
I create a class specified as MyProducts extends PHP2DB_Products. The
MyProducts class contains a method called CalculatePrice. The following
code would fails, since the return type of the findById method is
PHP2DB_Products.
$prod = MyProducts::findById($db, $eventersId);
echo $prod->CalculatePrice();
Casting is not an option since that would mean I'd have to upcast, which
is not safe.
It would be nice of the plug-in would generate both the entity classes
from the database tables and extended classes that people can use to
program their own logic. The entity classes could then return the extended
types.
Original issue reported on code.google.com by [email protected]
on 18 Nov 2009 at 11:02
i downloaded the following netbeans plugin : db2phpnb-1.107.nbm from ¨Project
home page
i opened netbeans and installed the plugin successfully
i created a new php projet in netbeans
and i started to create a new blank php page
and in the dialog , i clicked on PHP Entity Class from Database
i selected the database connection from the menu and after i selected all the
available tables shown in the listbox
then i clicked next then finish , the Model class are created in the root
folder of my php application ( webapp ) : webapp/models
and then i started coding , i tried to copy paste the example provided :
<?php
include_once 'SituMembersModel.class.php';
$db=new PDO('mysql:dbname=situ;host=localhost', 'user', 'password');
// query all members with dexterity=12 and reasoning=4 (query by example
currently only available for PDO!)
$example=new SituMembersModel();
$example->setDexterity(12)->setReasoning(4);
foreach (SituMembersModel::findByExample($db, $example) as $member) {
echo $member->getId() . ':' . $member->getName() . "\n";
}
i made all changes for my database :
include_once 'SituMembersModel.class.php'; became include_once
'models/MessagesModel.class.php';
SituMembersModel became MessagesModel.class.php
SiteMembersModel() became MessagesModel()
SituMembersModel::findByExample became Messages::findByExample
and so on ...
i tried to execute but it fails !!!!
it showns error like these :
Error # 1 :
Fatal error: Class 'Db2PhpEntityBase' not found in C:\Program Files\Apache
Software Foundation\Apache HTTP
Server\htdocs\webMessaging\models\Messages.class.php on line 9
This error was fixed by generating the php helpers available in this version of
netbeans
the i have had now a new folder in my webapp called helpers : webapp\helpers
and this time i tried to include the missed class in the root file ( index.php
) where i started coding and now the error disappear and a new error is shown
instead
Error # 2 :
Fatal error: Interface 'Db2PhpEntity' not found in C:\Program Files\Apache
Software Foundation\Apache HTTP
Server\htdocs\webMessaging\helpers\Db2PhpEntityBase.class.php on line 36
this time it needs a new class interface to work properly , i do the same by
including this class first and then the previous one , and now it should work ,
but a new error is shown
Error # 3 :
Fatal error: Interface 'Db2PhpEntityModificationTracking' not found in
C:\Program Files\Apache Software Foundation\Apache HTTP
Server\htdocs\webMessaging\models\Messages.class.php on line 9
the same as the previous ones , i included this one after the two others
so finaly we will get something like this :
include('helpers/Db2PhpEntity.class.php');
include('helpers/Db2PhpEntityBase.class.php');
include('helpers/Db2PhpEntityModificationTracking.class.php');
include('models/Messages.class.php');
and this time it should work , but unfortunately , not yet , another errors
will be displayed like the next one :
Error #4 :
Fatal error: Class 'DFCAggregate' not found in C:\Program Files\Apache Software
Foundation\Apache HTTP Server\htdocs\webMessaging\models\Messages.class.php on
line 493
and after fixing it , the last one is :
Error #5 :
Fatal error: Interface 'DFCInterface' not found in C:\Program Files\Apache
Software Foundation\Apache HTTP
Server\htdocs\webMessaging\helpers\DFCAggregate.class.php on line 35
and then this one :
Error #6 :
Fatal error: Class 'DSC' not found in C:\Program Files\Apache Software
Foundation\Apache HTTP Server\htdocs\webMessaging\models\Messages.class.php on
line 560
and then this one :
Error #7
Fatal error: Uncaught exception 'Exception' with message '00000:array ( 0 =>
'00000', 1 => 1064, 2 => 'You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax to
use near \'"messages"\' at line 1', )' in C:\Program Files\Apache Software
Foundation\Apache HTTP Server\htdocs\webMessaging\models\Messages.class.php:514
Stack trace: #0 C:\Program Files\Apache Software Foundation\Apache HTTP
Server\htdocs\webMessaging\models\Messages.class.php(501):
Messages::fromStatement(Object(PDOStatement)) #1 C:\Program Files\Apache
Software Foundation\Apache HTTP
Server\htdocs\webMessaging\models\Messages.class.php(474):
Messages::findByFilter(Object(PDO), Array, true, NULL) #2 C:\Program
Files\Apache Software Foundation\Apache HTTP
Server\htdocs\webMessaging\index.php(24): Messages::findByExample(Object(PDO),
Object(Messages)) #3 {main} thrown in C:\Program Files\Apache Software
Foundation\Apache HTTP Server\htdocs\webMessaging\models\Messages.class.php on
line 514
Now my question is that after fixing all this errors by including the required
dependencies to get the result of my code , i found that the generated Models
classes throw exceptions which shows that the code needs to be cleaned and
fixed ...
I found others errors in the called methods in your class ...
Can you help me a clean version of db2php because i need it for my project ...
??????????
Original issue reported on code.google.com by [email protected]
on 19 Apr 2013 at 5:11
Implement filters in generated Simple Interface Code
Original issue reported on code.google.com by [email protected]
on 20 Jul 2009 at 4:29
What steps will reproduce the problem?
1. generate model for test table (2 fields - id, description)
2. execute $record =OrmtestModel::findById($db, 1);
I expect to get the record where id=1
but instead get the following error
Code: 8
Message: Undefined index: SELECT * FROM `ormtest` WHERE `id`=?
File: OrmtestModel.class.php
Line: 235
I am using version 1.105 in Netbeans 7.1.2
However, if I execute
Ormtest::findBySql($db, "select * from ormtest where id = 1")
The correct record is returned.
Original issue reported on code.google.com by [email protected]
on 3 Jul 2012 at 8:39
Implement query by example in generated Simple Interface Code
Original issue reported on code.google.com by [email protected]
on 20 Jul 2009 at 4:30
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.