HibernateD and DDBC - ORM and DB abstraction layer for D

Vadim Lopatin coolreader.org at gmail.com
Fri Apr 5 07:03:19 PDT 2013


On Friday, 5 April 2013 at 12:13:42 UTC, Jacob Carlborg wrote:
>>> Looks much better know. I'm wondering though, if there need 
>>> to be a
>>> way to indicate a regular instance variable that isn't a 
>>> column.
>>
>> 1) Any private, protected, package members are not columns.
>
> Right, didn't think of that. What about methods, can you have a 
> method/property as a column?

As addition to fields, two more options supported:
1) Getter/setter pair:
      public T getSomeProperty();
      public xxx setSomeProperty(T value);
    or
      public T isSomeProperty();
      public xxx setSomeProperty(T value);
    treated as property with name 'someProperty'

    Second case is useful for boolean, to sound more natural
    Result type of setter doesn't matter.
    Both getter and setter should be defined, otherwise methods 
will be ignored.

2) Read/write property
    @property T someProperty() { ... }
    @property xxx someProperty(T value) { ... }
    treated as property with name 'someProperty'

BTW, I don't know how to check if property is read/write in 
compile time.


More information about the Digitalmars-d-announce mailing list