Negative ID in foreign key

16 views
Skip to first unread message

Anton Krasnoshchok

unread,
Jul 17, 2013, 5:12:14 AM7/17/13
to flexorm-...@googlegroups.com
Hi,

we are using FlexORM Framework for local database and sync it with server side db
for entity id we are using [Id(strategy="assigned")]

for new entities we are using negative id, to notify server about new data on sync

problem appears when we try to load entity with negative foreign key (foreign key object in null)

give us some idea how we can fix this problem please (maybe there is some positive check for foreign key id in FlexORM sources)

note: when we load entity direct (not via foreign key) - it's working properly with negative id

thanks

Best regards,
Anton

Stefan Habacher

unread,
Jul 17, 2013, 5:56:19 AM7/17/13
to flexorm-...@googlegroups.com
We currently solved it in this way:
In Class EntityMangerBase.as on line 384 there is function:

protected function idAssigned(id:*):Boolean
{
      return ((id is int && id > 0) || (id is String && id != null));
}

remove && id > 0 and it is also working with negative id´s.

Best regards,
Stefan
Reply all
Reply to author
Forward
0 new messages