Welcome Guest, Not a member yet? Register   Sign In
RapidDataMapper, a new Object-Relational-Mapper
#25

[eluser]Jelmer[/eluser]
I started trying to intergrate RDM into an existing system I have and I think I found a bug.

I'm using prefixes and when I don't set a table or anything in the data_model descriptor I get an following error that reads in part (I changed the database name to DBNAME):
Quote:'RapidDataMapper: ERROR: 1146: Table 'DBNAME.users' doesn't exist

Which I thought to fix by adding the prefix by using $this->setTable('pref_users') but then I got an error that read in part:
Quote:'RapidDataMapper: ERROR: 1146: Table 'DBNAME.pref_pref_users'

[I just edited the paragraph below because I first thought it was a problem within the find function instead of a difference between the find & update]
I believe that the first error is caused by a Db::find() statement and that the second is caused by Db:Confusedave() - and as such my guess is that the prefix is added when using update but isn't added when using find.

I'm trying to find it myself and will edit this post when I find the code, but you probably know precisely where to look.

[EDIT:]Solution
It took me a while but I did learn a lot from figuring out how it works and what I had to change. I found the problem in the Db_MapperQuery_Part_Properties class.
Line 21 says:
Code:
$this->addPart(new Db_CodeBuilder_Property('from', array($db->protectIdentifiers($desc->getTable()).' AS '.$db->protectIdentifiers($desc->getSingular()))));
Which doesn't add the db table prefix. I've changed it to:
Code:
$this->addPart(new Db_CodeBuilder_Property('from', array($db->protectIdentifiers($db->prefix($desc->getTable())).' AS '.$db->protectIdentifiers($desc->getSingular()))));
Which seems to have solved this.


Messages In This Thread
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-13-2009, 07:24 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-14-2009, 03:12 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-14-2009, 07:42 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-14-2009, 10:40 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-14-2009, 10:49 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-14-2009, 11:34 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-15-2009, 03:38 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-15-2009, 11:42 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 01:07 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 01:22 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 01:47 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 01:59 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 02:02 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 02:54 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 02:57 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 03:19 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 03:38 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 03:57 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 04:54 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 04:58 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 05:07 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-17-2009, 08:54 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-18-2009, 05:44 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-18-2009, 08:11 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-20-2009, 10:18 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-20-2009, 06:15 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-21-2009, 07:45 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-21-2009, 09:15 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-21-2009, 09:17 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-21-2009, 09:43 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-21-2009, 10:16 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-22-2009, 04:03 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-23-2009, 08:25 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-24-2009, 08:26 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-24-2009, 08:35 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-29-2009, 11:51 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-29-2009, 01:37 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-30-2009, 08:15 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-30-2009, 10:16 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 12-31-2009, 05:16 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 01-04-2010, 03:24 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 01-04-2010, 04:13 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 01-04-2010, 04:22 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 01-04-2010, 05:01 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 01-08-2010, 03:09 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 01-16-2010, 07:25 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 01-16-2010, 07:35 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 02-05-2010, 01:33 PM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 02-20-2010, 07:18 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 02-20-2010, 07:28 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 03-03-2010, 03:46 AM
RapidDataMapper, a new Object-Relational-Mapper - by El Forum - 03-04-2010, 09:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB