Check for presence of field

Posts   
 
    
happyfirst
User
Posts: 215
Joined: 28-Nov-2008
# Posted on: 09-Dec-2008 21:57:59   

I've added a RowVersion field to some of my oracle tables that are updated by a trigger. I've overriden an entities Save to add RowVersion to the updateRestriction predicate and everything works. I'm doing other custom things in Save and now I'd like the generator to do this for me for all objects where it's relevant. I've updated the entity.template and some of my code is now appearing and working. However, I need for the predicate code to only get added when that object has a RowVersion field. How do I do that?

Walaa avatar
Walaa
Support Team
Posts: 14987
Joined: 21-Aug-2005
# Posted on: 10-Dec-2008 09:54:19   

Why don't you just create your own concurrencyPredicateFactory class as described in the docs, and DI it to the entities you want.

Anyway is this what you are looking for? http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7636

happyfirst
User
Posts: 215
Joined: 28-Nov-2008
# Posted on: 10-Dec-2008 14:55:39   

I read the doc but that approach seemed like it required more coding than really needed. Dependency injection just seems like an overly complicated approach to solving problems that can be fixed with smarter templates. And any time a new object is added, developers would still need to remember to go take extra steps to "finish" that object. Otherwise, the object will still work but concurrency won't be in place.

Thanks to the link you provided, I've solved my problem and now it's solved once and for all. I don't have to worry about a developer forgetting to take the extra steps. Now it just works.

Thanks again, that "HasEntityField" is exactly what I was after. Where can I find more documentation on all the options available for us in a template? I did find in the documentation a list of all the "Current" object available.

Walaa avatar
Walaa
Support Team
Posts: 14987
Joined: 21-Aug-2005
# Posted on: 10-Dec-2008 16:04:35   

Did you check the SDK documentation?

happyfirst
User
Posts: 215
Joined: 28-Nov-2008
# Posted on: 10-Dec-2008 21:05:04   

What do you mean by "SDK" documentation?

I see a start menu shortcut to some documentation. I've found some basic references in there to template files and includes. I didn't find any compelete list of all available commands I can use in a template. If I search that doc for "HasEntityField" nothing is found.

I also downloaded a reference chm from your site but that doesn't seem to have anything either.

Walaa avatar
Walaa
Support Team
Posts: 14987
Joined: 21-Aug-2005
# Posted on: 11-Dec-2008 08:23:54   

The SDK package can be downloaded from the Extras section of the downloads page in the customer area