[Valentina][VSDK] M:M problems

Eric Forget forgete at cafederic.com
Mon Jan 20 16:08:29 CST 2003


> class CGroupPerson : public VDK_BaseObject
> {
>   public:
>       VDK_ObjectPtr        mGroupPtr;
>       VDK_ObjectPtr        mPersonPtr;
>       VDK_ULLONG           mGP;
> 
>   public:
>      CGroupPerson ()
>           :    VDK_BaseObject( "GroupPerson" ),
>                mGroupPtr( "Group", NULL, kFBL_CASCADE ),
>                mPersonPtr( "Person", NULL, kFBL_CASCADE )
>                mGP( "GP" )
>       {
>           // next call make field to be calculated
>           mGP.SetMethod( "some formula here" );
>       }
> };
> 
> 
> In ideal it seems we can use 8 bytes to join 2 RECID...
> This is easy do using string operations...
> 
> Ops, it seems for now way only string operations...
> We need add bit functions yet.
> 
> Please check if we have right now bit functions...
> If yes then 
> 
>           mGP.SetMethod( "BitAnd( shiftleft(mGroup,32), mPerson" );

For the my class:

class CGroupPerson : public VDK_BaseObject
{
  public:
      VDK_ObjectPtr        mGroupPtr;
      VDK_ObjectPtr        mPersonPtr;
      VDK_ULLONG           mGP;
 
   public:
     CGroupPerson ()
          :    VDK_BaseObject( "GroupPerson" ),
               mGroupPtr( "GroupPtr", NULL, kFBL_CASCADE ),
               mPersonPtr( "PersonPtr", NULL, kFBL_CASCADE )
               mGP( "GP", fUnique )
      {
          // next call make field to be calculated
          mGP.SetMethod( "some formula here" );
      }
};

I've tried all of these:

    mGP.SetMethod( "BitAnd( shiftleft(mGroupPtr,32), mPersonPtr" );
    mGP.SetMethod( "BitAnd( shiftleft(mGroupPtr,32), mPersonPtr)" );
    mGP.SetMethod( "BitAnd( shiftleft(GroupPtr,32), PersonPtr)" );

Unfortunately, I cannot add more than 1 record (whatever the combinaison of
person and group). It always return error 344 (kFBL_FieldIsUnique). Any
idea?

Éric

___________________________________________________________________

 Eric Forget                       Cafederic
 ForgetE at cafederic.com             <http://www.cafederic.com/>

 Fingerprint <86D5 38F5 E1FD 5D9C 71C3  BAA3 797E 70A4 6210 C684>




More information about the Valentina mailing list