The official Fatica Labs Blog! RSS 2.0
# Monday, 21 June 2010

Well, since no feedback from the users, I decided to abandon the project NHModeller. It was an attempt to create a commercial tool for NH, without any interesting returns. If someone is interested to have the source and continue the project please contact me. The project is now replaced by the new NHibernate Workbench, that is open source.

Monday, 21 June 2010 08:03:01 (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Code GEneration | NHModeller

# Monday, 14 June 2010

bug The right place for bug reporting or requiring additional features is

here

Since the project is new, it is normal to have something to fix. The problem is that my testing would just be not sufficient, so your help will really be appreciated. Thanks!

Monday, 14 June 2010 16:31:59 (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Code GEneration | NHibernate | NHWorkBench

# Saturday, 05 June 2010

With a little delay I found people complaining about the schema file missing from the db2hbm deployed package. Now the file is included in the download package, and yanch provided a shortcut in the doc to download the file from sourceforge. Thanks!

Well, a few word about db2hbm and Oracle ( and any other database but MSSQL now ). I used the schema information provided by NH as long as possible, but these information does not provides the required details in order to discover completely the foreign keys, and foreign keys are necessary for creating associations. Not really an NH problem, actually NH leverages ADO.NET for schema inquiry, but ADO.NET seems to miss the foreign key part. So the only solution to have db2hbm working for all database is to provide a custom foreign key crawler for the DB.

Saturday, 05 June 2010 14:32:40 (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Code GEneration | NHibernate

# Monday, 31 May 2010

First of all I renamed the project on Sourceforge. Now it is more sensible NHibernate Workbench.

nhwsourceforge

In the SVN repository there is now a tag to the version 1.0.0.11, and the trunk claim to be the version 1.0.0.2.00.

Now I’m planning to allow to use NH Workbench attached to a running application: this should help us to play with application compiled without mappings ( ie ConfOrm and Fluent NH ). Then I would like to improve the “Probe” class letting it be more versatile and modifiable by the user, probably using some sort of script engine: I’m thinking to use IronPython, but any suggestion are welcome. Just to clarify: the probe class serves to insolate NHWorkbench from the NH version used by the project under test. We basically runs the test in a separate app domain, but we need the “probe” type to be unbounded to any NH specific version. This is done by using reflection, but it would be easier to be done in a script. The same engine will be useful to write some NHibernate testing: instead of use just HQL, we will be able to submit some portion of code on the fly and see what happen. The other step is to allow the user writing a mapping on the fly and imemdiately see what happen ( by using hbm2net behind the scenes ). Ok, it’s a lot of work, I’ve no idea the order this will be done, let me know if you have any idea and preference.

Monday, 31 May 2010 11:35:43 (GMT Daylight Time, UTC+01:00)  #    Comments [1] - Trackback
Code GEneration | HQL Intellisense | NHibernate | NHWorkBench

# Monday, 24 May 2010

Sometimes I receive some notification on where source code for both db2hbm and hbm2net are located. The best way is to check-out the source of the NHContrib project: https://nhcontrib.svn.sourceforge.net/svnroot/nhcontrib

hbm2net is still in alfa, but I frequently use it in my projects as a class generator. It really lack some documentation: it is really a powerful artifact generator, and by writing proper T4 templates any artifact can be generated. Db2hbm is working ok for MSSQL, but there is not yet an implementation for oracle and other DB, even if Ricardo Peres provided me some interesting code to work on.

Hope this help who’s looking for these tools source code.

Monday, 24 May 2010 20:08:30 (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Code GEneration | NHibernate

# Wednesday, 19 May 2010

In the spirit of “Release early. Release often. And listen to your customers” ( cit. ), even if not so early in term of time since the preview, I decided to release a first drop of the “HQL Intellisense thing” I’m working on. The current version is just able to load an existing mapping assembly, a configuration, help us to write an hql query, submit it to NH and see some results. Here an overall screenshot:

s1

To use it you need to download the bits, and then “create a project” a project is, in the NH Workbench world, a bounch of file representing what we are working on ( and actually is a project in the MSBUILD world. To use the tool now we need at least a working NH configuration file ( your app.config or web config ) and one or more mapping assembly(ies). You add the files to the project by right clicking the project tree:s2

After you added the file you can save the project, so it can be reopened when needed. Please note that the mapping assembly has to be opened from a location containing all the required dependencies ( usually the application folder, or the bin folder ).

After the project is created, you need to compile it before starting to write the queries:

s3

You can compile the project by clicking the button on the toolbar as shown in the picture Fig3

 

 

 

Compiling the project should produce a report in the log area:

s4

If you find the report too verbose, you can uncheck some of the button in the log toolbar. After a successful compilation, we can open a query (hql) document:

s5

This will open a pane in the document area in which we can write HQL queries with some intellisense/auto-completion. Plaese note that, for have the entity completion, after the “from” keyword we need to press ctrl+space to see the completion combo.

 

 

 

 

 

 

s6

Here an example HQL document. After a valid query is done we can submit it to NH and see the result:

 

The “play” button is enabled only if a valid query ( no errors ) is written in the document. The first and count places are useful to limit the query results.

s7 By pressing the play button, you will be able to se the query results ( if any ):

s8

Next steps:

  • Solve the bugs till now
  • Add supports for hbm2net, so user can write mapping and immediately see it at works.

Enjoy !

Wednesday, 19 May 2010 16:30:52 (GMT Daylight Time, UTC+01:00)  #    Comments [10] - Trackback
Code GEneration | NHibernate

There was a bug in the many-to-many strategy, causing a null reference exception. The bug was solved, and a current snapshot of db2hbm can be found here as usual.

db2hbm

Wednesday, 19 May 2010 10:13:46 (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Code GEneration | NHibernate

# Thursday, 22 April 2010

There is some interesting progress with my project Fatica.Labs.HqlEditor. I just want to share some screenshot:

s5

Well, it is growing to be a real tool, and in my idea would became a sort of test bed in which the user can add or modify mapping, try the queries, change the config, export a database script, reverse engineering and so on. Actually all the low level tool to achieve that are available.

Ok, let’s explain the layout:

  1. The document area, here we have mapping/config/hql all with intellisense. In the screenshot the code completion for an Hql is shown. In future maybe I will be able to insert a T4 editor for the hbm2net templates.
  2. The project area: here we have a bounch of file that are representing our testing project: mapping, configurations, assemblies and so on. I have use the MSbuild object as a backend for the project, because in the near future I would like to use it to really build some artifacts using hbm2net and db2hbm.
  3. Here is the SQL preview of the query in editing. Now the view is showing an error because the query is incomplete.
  4. The funny log, a graphical appender for log4net :-)

Some more words about the project itself: the testing environment is hosted in a separate appdomain, this will allow us to:

  • Modify the mapping runtime generating new version of the assembly
  • Testing production assemblies built with legacy nh versions ( well, not so legacy, starting from 2.xxx )

Let’s have another screenshot, showing a real SQL preview:

s7

Next step is to produce the query results in some sort of usable representation ( I need to push the data across two app domain ) so I would probably use some JSON serialization and then display the JSON raw data with some readable formatting.

You can see a little demo video here.

The project is not yet released, please treat it as a CTP ;) anyway, the svn repository is here:

https://faticalabshqled.svn.sourceforge.net/svnroot/faticalabshqled

Thursday, 22 April 2010 17:41:58 (GMT Daylight Time, UTC+01:00)  #    Comments [2] - Trackback
Code GEneration | HQL Intellisense | NHibernate | NHWorkBench

# Tuesday, 16 June 2009
Here you can find an Inflector ( a strategy to singularize, pluralize case convert and much more ) very useful in code generation. Supported languages are now English and spanish.
Tuesday, 16 June 2009 09:37:00 (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Code GEneration

My Stack Overflow
Contacts

Send mail to the author(s) E-mail

Tags
profile for Felice Pollano at Stack Overflow, Q&A for professional and enthusiast programmers
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2017
Felice Pollano
Sign In
Statistics
Total Posts: 157
This Year: 0
This Month: 0
This Week: 0
Comments: 124
This blog visits
All Content © 2017, Felice Pollano
DasBlog theme 'Business' created by Christoph De Baene (delarou) and modified by Felice Pollano