pokara93 | 4 Oct 2004 13:18

problem persist objects with null values


hello, with the new version I can persist an object that have another 
object that it is not persisted.For example, I have I class venta 
(sale) that have an object of a class cliente (client), but not all 
the "sales" have a "client", before new version if this object is not 
initialize and persisted put the null value and all works fine. But 
now to persist "sale" object i must to persist "client" object 
before. How can i do it that? i can't create an empty "client" 
because the "client" have another object inside and this have 
another... a chain of objects that must to be persist before ... any 
ideas?
thank you

pokara

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Manuel Lemos | 4 Oct 2004 19:59

Re: problem persist objects with null values


Hello,

On 10/04/2004 08:18 AM, pokara93 wrote:
> hello, with the new version I can persist an object that have another 
> object that it is not persisted.For example, I have I class venta 
> (sale) that have an object of a class cliente (client), but not all 
> the "sales" have a "client", before new version if this object is not 
> initialize and persisted put the null value and all works fine. But 
> now to persist "sale" object i must to persist "client" object 
> before. How can i do it that? i can't create an empty "client" 
> because the "client" have another object inside and this have 
> another... a chain of objects that must to be persist before ... any 
> ideas?

Right, you can't tell an object to store a reference to an object that 
was not persisted because it does not make sense. It is explained in the 
troubleshooting guide:

http://www.meta-language.net/metastorage-troubleshooting.html#non-persisted-references

The change in the setreference functions code was made to prevent bugs 
in your application.

If you want the sale object to not point to any client object in some 
cases, just pass a null to the setreference function. You do not need to 
create an client object to pass it to the setreference function.

--

-- 

(Continue reading)

pokara93 | 5 Oct 2004 11:14

Re: problem persist objects with null values


> If you want the sale object to not point to any client object in 
some 
> cases, just pass a null to the setreference function. You do not 
need to 
> create an client object to pass it to the setreference function.

ok, but if i call setreference with null, when i persist the object 
sale and checked if isset client, the report an error:

$sale->client=null;

'it was atempted to persist an object of the class Venta with a 
required variable that is not initialized'

if i put it as: 

$sale->setClient(null); 

don't return to me nothing ¿¿¿¿?????

and if i put:
$myclient=null;
$sale->setClient($myclient); 
report:
"it was attempted to set the cliente reference variable of class 
Venta to a null object"

at this moment to works allright, i was create a client with null 
values and id = 0.
(Continue reading)

Manuel Lemos | 5 Oct 2004 14:16

Re: Re: problem persist objects with null values


Hello,

On 10/05/2004 06:14 AM, pokara93 wrote:
>>If you want the sale object to not point to any client object in 
> some 
>>cases, just pass a null to the setreference function. You do not 
> need to 
>>create an client object to pass it to the setreference function.
> 
> ok, but if i call setreference with null, when i persist the object 
> sale and checked if isset client, the report an error:
> 
> $sale->client=null;
> 
> 'it was atempted to persist an object of the class Venta with a 
> required variable that is not initialized'
> 
> 
> if i put it as: 
> 
> $sale->setClient(null); 
> 
> don't return to me nothing ¿¿¿¿?????
> 
> 
> and if i put:
> $myclient=null;
> $sale->setClient($myclient); 
> report:
(Continue reading)

pokara93 | 5 Oct 2004 18:24

Re: problem persist objects with null values ok!


ok!thank you very much

pokara

------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
pokara93 | 6 Oct 2004 17:09

new field in database


hello, when I change my component and insert a new file in the 
database,all seems all right but, when i work with new database 
report me this error:

Unknown column 'CodigoBalance.nombre' in 'field list'

the "nombre" value is the new column. If i see the database structure 
this columns appears, and don't understand why report me this error 
when i change my database some times and nothing was wrong. Is 
possible bug of new version, do i make anything wrong?

thank you!

pokara

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Manuel Lemos | 6 Oct 2004 21:38

Re: new field in database


Hello,

On 10/06/2004 12:09 PM, pokara93 wrote:
> hello, when I change my component and insert a new file in the 
> database,all seems all right but, when i work with new database 
> report me this error:
> 
> Unknown column 'CodigoBalance.nombre' in 'field list'
> 
> the "nombre" value is the new column. If i see the database structure 
> this columns appears, and don't understand why report me this error 
> when i change my database some times and nothing was wrong. Is 
> possible bug of new version, do i make anything wrong?

This is strange. When you change your model definition and Metastorage 
generates a new database schema, you need to install it with the same 
schema installation class.

When you do this, that class changes the database schema without 
affecting any data that was stored there before.

If you did this, the error above should not happen. Are you sure you are 
using the same database in your application with the changed schema?

--

-- 

Regards,
Manuel Lemos

(Continue reading)

pokara93 | 7 Oct 2004 17:14

Re: new field in database


sorry, this that happend,after actualice the database schema,in main 
aplication I have just work with older version of database.sorry.
thanks for your patience.
pokara

------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
pokara93 | 21 Oct 2004 17:45

beginswith


hello, i was worked with the last version of metastorage (in this 
case i checked it before write here), and when i try to use the 
beginswith, contains or endswith tags, report this message:

Compilation resultsStatus: Failed 
Error: beginswith is not a valid filter argument 
File: factoria.component 
Line: 628 
Column: 9 
Byte: 12804 

my code is:

    <function>
      <name>getCuentaPorNombre</name>
      <type>getcollection</type>
      <argument>
        <name>nombre</name>
        <type>text</type>
      </argument>
      <parameters>
       <collection>cuentas</collection>
       <filter>
          <variable>
            <name>descripcion</name>
            <object>Cuenta</object>
          </variable>
         <beginswith />
          <argument>nombre</argument>
(Continue reading)

Manuel Lemos | 21 Oct 2004 19:19

Re: beginswith


Hello,

On 10/21/2004 12:45 PM, pokara93 wrote:
> 
> hello, i was worked with the last version of metastorage (in this 
> case i checked it before write here), and when i try to use the 
> beginswith, contains or endswith tags, report this message:
> 
> 
> Compilation resultsStatus: Failed 
> Error: beginswith is not a valid filter argument 

beginswith is not yet implemented. It is in the to do list.

I was willing to implement it but then I realized that it is not that 
simple to make it database independent. The problem is that SQL LIKE 
expressions may contain wildcard characters _ % . If you beginswith 
expression contains the wildcard characters, those need to be escaped. 
Escaping wildcard characters varies a little with different databases.

Therefore, I need to implement generate the SQL for beginswith 
expressions within Metabase. That is not difficult but to make sure it 
works right before I make a release, I need to test it in all databases 
supported by Metabase.

So, if you need that with a certain urgence, what I can do for now is to 
implement it in the Metabase driver for the database you use and later I 
will make the necessary tests when I have more time to make a new 
Metabase release. Just let me know which database you use so I can give 
(Continue reading)


Gmane