I have to assume I’m missing something. My generated project has the usual TypedListDAO along with xxxDAO for each entity in the project.
It seems to me that any DAO can be used to consume any dynamic query and none of them appear to have public properties related to the entity they come from (I see there is something internally but they’re not exposed) - therefore they cannot be used like TypedListRow objects or any other DTO. Each DAO seems to be just a mechanism to consume a DynamicQuery.
What I was assuming is that if I want a typed resultset, I would be able to use one of the corresponding DAOs that matches the entity I’m working with. It only makes sense. If I want a typed resultset that includes ALL fields, I thought these DAOs would work similar to TypedListRows. But they don’t seem to work this way.
Of course, I can create a typed list that has every field from every entity they come from from, but that seems like a lot of work to simply get every field. Yes, I can hand-code my own DAO with the fields I want, I can do a lambda that returns an anonymous, and yes I can do an entity fetch (but I don’t want to do that as they’re more heavyweight and don’t serialize in self-servicing).
So, I found that if I have this:
//StatesTypedListRow is from a TypedList.
var c7 = new StateDAO().FetchQuery(qf.Create().Select<StatesTypedListRow, StateFields>());
it can be replaced with this:
var c7 = new TypedListDAO().FetchQuery(qf.Create().Select<StatesTypedListRow, StateFields>());
So if this is the case, why have so many DAOs that appear to do the same thing except have different names?
Also, I originally tried this as if each DAO was also a DTO (I just wanted a typed result):
//StateDAO is generated by LLBLGEN
var c7 = new StateDAO().FetchQuery(qf.Create().Select<StateDAO, StateFields>());
as well as every other possible way and none of this works.
As far as I can see, I can use the TypedListDAO for everything and every other DAO is redundant. Every DAO is NOT a DTO. Any help clearing this up would be appreciated.