Wow, I didn't know that!

Tuna Toksöz
Eternal sunshine of the open source mind.

http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike




On Sun, Aug 9, 2009 at 7:24 PM, Fabio Maulo <[email protected]> wrote:

> http://nhforge.org/doc/nh/en/index.html#querysql-load
>
> 2009/8/9 mathmax <[email protected]>
>
>>
>> Hello,
>>
>>
>> I have a table (shipment_days) with the following structure:
>>
>> Shipment    Day    Price
>>
>> Shipment is an id of type string but doesn't refer to any shipment
>> table. For one shipment, there are several days. Although there is no
>> Shipment table, I would like to have a "Shipment" entity in my program
>> and a relation 1-n with the entity "Day".
>> I know I should have a table with one shipment per line to generate c#
>> entities. A solution could be to create a view like this:
>>
>> select distinct Shipment as ID, REPLACE(Shipment , '_', ' ') as label
>> from shipment_days
>>
>> and then map the view just as I would map any other table in my data
>> model.
>>
>> But I would prefer to avoid creating this view on the database side.
>> It would be nice to have the possibility to write something like this
>> in the mapping file:
>>
>> <class name="Shipment" table="select distinct Shipment as ID, REPLACE
>> (Shipment , '_', ' ') as label from shipment_days"/>
>>
>> Any other solution will be welcome.
>>
>> Best regards,
>>
>> mathmax
>>
>>
>
>
> --
> Fabio Maulo
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to