HenkO wrote:
Thanks for your quick response, I have tried your suggestions but I can’t get them working.
Ok, I should have mentioned that the examples were for 'SelfServicing'. I assume you generated code for 'Adapter' then. We support two different paradigms: selfservicing (which has the persistence logic in the entities (like customer.Save()) and adapter which has teh persistence logic in a separate object (adapter.SaveEntity(customer)).
Option 1.
Dim customer As New CustomerEntity()
customer.FetchUsingUCName("Henk")
The customer object has no Fetch… method
Correct, you have to do for adapter:
Dim customer As New CustomerEntity()
customer.Name = "Henk"
Dim adapter As New DataAccessAdapter()
adapter.FetchEntityUsingUniqueConstraint(customer, customer.ConstructFilterForUCName())
That is, if Name has a unique constraint of course.
Option 2.
Dim filter As Predicate = PredicateFactory.CompareValue(CustomerFieldIndex.Name, ComparisonOperator.Equal, "Henk")
CustomerCollection customers = new CustomerCollection()
customers.GetMulti(filter)
I don’t have a Customer collection
Correct, Adapter has untyped collections.
For adapter you do this:
Dim adapter As New DataAccessAdapter()
Dim filter As New RelationPredicateBucket()
filter.PredicateExpression.Add(PredicateFactory.CompareValue(CustomerFieldIndex.Name, ComparisonOperator.Equal, "Henk"))
EntityCollection customers = new EntityCollection(new CustomerEntityFactory())
adapter.FetchEntityCollection(customers, filter)
During the code generation I receive the following messages :
Could not find template 'SD_ActionProceduresAdapterTemplate'. It is not defined in the template set config file.
Could not find template 'SD_RetrievalProceduresAdapterTemplate'. It is not defined in the template set config file.
I’m working on a MsAccess 2003 database.
That's normal, stored procedures on access aren't supported, so the template isn't defined. You can safely ignore that error.