in

Community

Take part in the community surrounding CodeBreeze and other products from SteelBlue Solutions.
Latest post 10-29-2008 8:24 AM by shawndewet. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-08-2008 3:53 AM

    Target Tags and Foreign Keys

    I'm evaluating CodeBreeze.  We have our own inhouse code generator that I'm considering replacing with CodeBreeze, but there is one concept I can't figure out how to implement in CodeBreeze.  This has to do with Foreign Keys.  eg, I have a SalesOrder table in the database that has a SalespersonID field, which has a foreign key reference to the Salesperson table.  When we generate code from these two tables using our inhouse code generator, we end up with a SalesOrder class and a Salesperson class. The SalesOrder class has a readonly property called "MySalesperson", which returns an object of type Salesperson.

    Now to achive this in CodeBreeze I imagine the use of Target Tags would be the way to approach it?  But I would appreciate some guidance on how to set this up.  Can I create my own target tag called FKParent?  And then assign a value of Salesperson to this tag on the SalesOrder business entity?  Then it would be even more awesome if I could extend CodeBreeze to populate this tag automatically based on the foreign keys it finds in the database.  Please advise on how this could be done, if at all?

  • 10-10-2008 3:17 AM In reply to

    Re: Target Tags and Foreign Keys

    You are right, target tags are the way to accomplish this.  Unfortunately, as of right now they are all manual.  This need you're describing however, has been expressed by others so an auto-gen of target tags is in the works.  In the tradition of CodeBreeze extensibility, we're not going to hard-fix a way to populate them from foreign keys.  Instead the plan is to place a plug-in point into the auto-generation of target tags, ship with a plug-in to do what you're looking for, but allow you to also write any other type of auto-gen plug-in for target tags and insert it at the same point.  This would solve your problem and possibly other needs that come up later.  Unfortunately, we cannot guarantee that this feature will make it into the CodeBreeze 1.1 build that's soon to be released (before end of year).  If it does not though, it is at the very top of the list for a following build.

    I hope this does not deterr your purchase of CodeBreeze but I certainly understand.  Thanks for giving us a try and we hope we can help you further.

  • 10-15-2008 1:26 AM In reply to

    Re: Target Tags and Foreign Keys

    Cool I'll look forward to v1.1.  In the meantime though, is there a way to manually add new Target Tags?  From what I see in the template code that Target Tags are accessed by key (eg, Entity.Tags("IsChild").Value) I would imagine this should be possible?

  • 10-29-2008 8:24 AM In reply to

    Re: Target Tags and Foreign Keys

    Never mind...I've found this in the editing of a project template.

Page 1 of 1 (4 items)
2008 - All rights reserved
Powered by Community Server (Commercial Edition), by Telligent Systems