The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Intellisense Generator

Last post 06-05-2008, 1:08 AM by pritcham. 22 replies.
Page 2 of 2 (23 items)   < Previous 1 2
Sort Posts: Previous Next
  •  05-28-2008, 10:34 AM 9527 in reply to 9515

    Re: Intellisense Generator

    Martin (pritcham) has provided a version which outputs a VB.NET equivalent of Trevor's (TrevorW) C# template. I've renamed the template filenames and Template Property names so that you can have both, and easily tell them apart in MyGeneration's template browser. If you downloaded the previous C# version, you should delete the file before un-zipping this one. They have the same guid, but different filenames, which will confuse MyGeneration. (I've removed the link in the previous post to avoid duplication.)

    Create a folder under your MyGeneration Templates folder and un-zip one or both templates into it. You should be able to find the templates under the "DatabaseSchema" namespace in the MyGeneration Template Browser. They are ES2007 style templates, so you'll need esPlugin.dll in your MyGeneration Program Folder. The generated class stands completely on its own, so you should be able to include the file in either ES2007 or ES2008 projects.

    Thx, Trevor and Martin

    C# Intellisense Generator (TrevorW)

    VB Intellisense Generator (pritcham)


    David Neal Parsons
    www.entityspaces.net
  •  05-28-2008, 11:10 AM 9529 in reply to 9515

    Re: Intellisense Generator

    1) If the DB name has spaces in then the class generated includes those spaces and therefore won't compile - easy enough to remove them but thought it worth a mention

        Ah! Thanks, hence the reason for "testers". I never use spaces within column names.

    2) The class summary comments - it currently shows something along the lines of "/// The 123Whatever table" which is the cleaned up version of the table name rather than "the 123 What ever table" - I'd just use the "source" name here rather than running it through the esPlugin.Entity() method.

        I have to consider this carefully along with with your #1 comment from above. For me, the table names are used as the core of what ES uses for naming ES classes. The primary purposes for building this "helper" is:

            1: To assist with building ES queries in a disconnected fashion. For example, there is a table "Categories" in the Northwind database. ES will build "Categories", "CategoriesCollection", "CategoriesQuery", etc. I dynamically invoke ES based on selecting an available "table". If I use a core name that differs from the core named by ES, nothing will invoke properly. My initial thought is to corrct your #1 comment above to "cleanup" via ES and add another property (if its not there) that would refere to the "RawTableName" or DatabaseTableName".

            2: To assist with discoverability. I make sure that all possible properties are always referenced to eliminate confusion. For example, even if certain properties don't apply, I have values available and specify what values indicate they are not used in the comments so that a user doesn't run into properties appearing and not appearing for each respective table and sub-properties. If no foreign keys are defined, the class will still be created without any properties. The user will always see a reference t foreign keys for every table.

    3) Your references to ES names (especially copyright notice)

        I will correct what you identified - I agree. However, I will still leave a header that defines the ES assemblies versions, etc and still reference ES. There is no questionthat te helper is designed specifically to be inter-related to ES objects. It is not designed to be totally independant. Again, as I desribed above, the naming must match ES naming conventions because the values are sued to dynaically invoke ES objects. I know that i I pass in the correct name for "Categories" for the Northwind dtabase, that I can dynamically invoke the class "CatgoriesQuery".

    I will clean this up and continue on the Query Builder. The first version will not support sub-queries or "IN" statements. Once the simple queries are working, I am hoping to add support for more advanced queries and eventually support them all (if possible).

    BTW: I am sure users will like having a VB version. Thanks for that!  

    ALSO: Do you (or anyone) know if you can get the SQL generated from an ES query WITHOUT actually having to RUN the query? I want to have the Query Builder be capable of outputting the SQL and the equivelant Code besides actually running the query and returning the results.

    TIA

     

  •  05-28-2008, 3:09 PM 9535 in reply to 9529

    Re: Intellisense Generator

    Hi Trevor

    Firstly, I think you must have misunderstood what I meant in your point 2 - I was only referring to the (<summary>) comments that get generated, not the strings (i.e. the summary comment above the class definition say that the class is based around suchandsuch table so my suggestion was that in those comments (only) you use the actual, untouched, table name from the DB - the rest of the generated code would be as-is - very much a cosmetic change.

    As for your question on getting the SQL without running the query, I don't think it's possible currently as I believe it's not actually generated until you call "Load" - could be wrong on that one though so perhaps one of the ES guys can chip in?

    As a side note, if you want any testers etc for the query builder (which I haven't had time to progress with in all honesty) then feel free to give me a shout

    Cheers

    Martin

  •  05-28-2008, 6:43 PM 9536 in reply to 9535

    Re: Intellisense Generator

    Re: Getting the SQL without calling Load

    I can confirm that it is not possible. It is already in our enhancement tracking system, though. So... some day Wink


    David Neal Parsons
    www.entityspaces.net
  •  05-28-2008, 10:26 PM 9538 in reply to 9536

    Re: Intellisense Generator

    What about creating a "dummy" load method ?

    perhaps... LoadSimulate();

     

    Under-the-hood all is the same except the connection isn't verified and the query isn'y actually run... perhaps?  My issue is wanting to view/get access to the SQL even if the server/database isn't actually available. I know you are busy with lots of requests and many are certainly more important... just suggesting. 

  •  05-30-2008, 7:30 AM 9554 in reply to 9538

    Re: Intellisense Generator

    Hi

    I might have figured a way to achieve this but I want/need to check with the ES guys as to whether it's something they wouldn't mind me sharing and more importantly, whether my approach misses something obvious - I've just sent an email to the support address so will feedback when I have news

    Cheers

    Martin

     

  •  05-31-2008, 5:04 AM 9567 in reply to 9554

    Re: Intellisense Generator

    Hi

    Just wanted to check whether the email I sent yesterday to the es support email address with code to achieve this arrived ok? Not pushing just want to make sure it arrived ok?

    Cheers

    Martin

  •  06-05-2008, 1:08 AM 9638 in reply to 9538

    Re: Intellisense Generator

    Folks

    Please see the following post for an example of how to get to the generated SQL without having to call Load()

    http://community.entityspaces.net/forums/9637/ShowThread.aspx#9637

    Cheers

    Martin

Page 2 of 2 (23 items)   < Previous 1 2
View as RSS news feed in XML