I saw the database specification and see that for a relation it looks like this:
<relation [name="SomeRelation"][id="1"][unidir="true"]>
<relate object="Person" [unique="false"][limit="one"][handle="cars"]/>
<relate object="Car" [limit="many"][handle="owner"]/>
... more related objects ... [<field name="order" type="integer"/>]
... more relation attributes ...
</relation>
where field is defined as [<field name="order" type="integer"/>].
so it's implemented correctly and would be more of a feature request. :)
here is the example.
I have a User object, and it has a gender field, which has 0 and 1 as its values.
There's also a Friend relation, which has a status field, and it also has 0 and 1 as its values.
Inside model.hpp, I don't see Friend::Status::requested or Friend::Status::connected anywhere.
Gracias!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could you elaborate a little bit more? Perhaps a little example? ;)
I saw the database specification and see that for a relation it looks like this:
<relation [name="SomeRelation"] [id="1"] [unidir="true"]>
<relate object="Person" [unique="false"] [limit="one"] [handle="cars"]/>
<relate object="Car" [limit="many"] [handle="owner"]/>
... more related objects ...
[<field name="order" type="integer"/>]
... more relation attributes ...
</relation>
where field is defined as [<field name="order" type="integer"/>].
so it's implemented correctly and would be more of a feature request. :)
I wish it could be more like this:
<field name="color" type="integer">
<value name="Red" value="0"/>
<value name="Green" value="1"/>
</field>
where having the value tags in the field tag mean constants are automatically generated for you, like
Class::Field::Constant1
Class::Field::Constant2
Is implemented.
see http://sourceforge.net/apps/trac/litesql/wiki/DefiningDatabase
and the exampledatabase.xml in litesql/example (see Person::sex).
It should also work for fields in relation.
I feel like it wasn't working for when it's inside relations tag but I will double check.
maybe not working inside relations. waiting for reporters check.
Last edit: Gulliver 2014-02-24
http://collabedit.com/xpr3x
here is the example.
I have a User object, and it has a gender field, which has 0 and 1 as its values.
There's also a Friend relation, which has a status field, and it also has 0 and 1 as its values.
Inside model.hpp, I don't see Friend::Status::requested or Friend::Status::connected anywhere.
Gracias!
fix is in git repository