[Valentina][VSDK] M:M problems
Ruslan Zasukhin
sunshine at public.kherson.ua
Tue Jan 21 00:57:26 CST 2003
on 1/21/03 12:31 AM, Eric Forget at forgete at cafederic.com wrote:
>> I have ask look into SQL.pdf for correct names of functions,
>> I just do not remember.
>>
>> Okay, I have look inside, and I see that we have made in Valentina
>> << and >> operators
>>
>> So at least must be
>>
>> mGP.SetMethod( "BitAnd(mGroupPtr << 32), mPersonPtr" );
>>
>> And now we need find how correctly do bit AND ...
>> Ops. I do not see function for this...
>> Okay I need add them.
>>
>> But it seems you can simply use +
>>
>>
>> mGP.SetMethod( "(mGroupPtr << 32) + mPersonPtr" );
>
> Unfortunately, it still doesn't work. Are you sure it is the class member we
> put there and not the column name? Sorry if it looks naïve, but I really
> don't understand how it works...
Do you work on MAC or Windows ?
If on MAC, you can take VAPP and play with methods.
Eric, we simply try create virtual calculated field
To be COMPOUND of 2 first.
Look, let you have f1 and f2 fields in table as ULONG.
Now you can create f3 with method "f1 + f2"
So you get
f1 f2 f3
----------------------------
1 1 2
1 5 6
4 9 13
You see, f3 is not stored on disk, it is calculated on the fly by formula.
I think problem is that you have ObjectPtr fields.
I recall that we need wrap them at first my ULONG BaseObject methods.
So we need simply add 2 more BaseObject methods which are NOT indexed.
class CGroupPerson : public VDK_BaseObject
{
public:
VDK_ObjectPtr mGroupPtr;
VDK_ObjectPtr mPersonPtr;
VDK_ULONG mG;
VDK_ULONG mP;
VDK_ULLONG mGP;
public:
CGroupPerson ()
: VDK_BaseObject( "GroupPerson" ),
mGroupPtr( "GroupPtr", NULL, kFBL_CASCADE ),
mPersonPtr( "PersonPtr", NULL, kFBL_CASCADE )
mG( "mG" ),
mP( "mP" ),
mGP( "GP", fUnique )
{
// next call make field to be calculated
mG.SetMethod("GroupPtr"); // now mg = GroupPtr, but has type ulong
mP.SetMethod("PersonPtr");
mGP.SetMethod( "(mg << 32) + mp" ); // case insensitive, btw
}
};
I have check here, formula on ULONG fields works correctly.
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list