[jbosstools-dev] Hibernate Property

Max Rydahl Andersen max.andersen at redhat.com
Fri Dec 7 09:07:06 EST 2007


Hi Dmitry,

>>>> cool - looks good.
>>>> Are you adding hbm.xml support too ?
>>>
>>> No I am not.
>>> It was added earlier.
>>
>> Also for components ?
>
> As I understood yuor first question was about how I find the mapping  
> file.
> In the old OpenMappingActionDelegate class we had method  
> openMapping(RootClass rootClass, ConsoleConfiguration  
> consoleConfiguration).
>
> As you see all I had to do is get RootClass and ConsoleConfiguration  
> from tree selection and call this method.
> Futher it is havent sence to me what a file opens, I had to find the  
> certain line in the file and select the name of selected element.

Ok.

> So, one of the problem is get RootClass from selected element which was  
> not resolved for containers properties.

Sure - but since these are properties/components you need to look for more  
than just
the RootClass. RootClass is only used for *entities* not for *values*  
which components
and are an example of.

Here you need to look for the property type as shown in Cfg2Java.

> I was visited by idea: is it possible that RootClass mapped in one file  
> and its subclass in another?

hbm.xml supports these two ways of defining subclasses:

<class name="Person">
   ...
   <subclass name="Student">
     ...
   </subclass>
</class>

OR

<class name="Person">
   ...
</class>

<subclass name="Student" extends="Person">
   ...
</subclass>

First one will always be in the same file.
Second one can be in the same or different files.

> In this case my resolution will not work.

> Should we commit our changes?

Please write unittests for it before doing that.

Should be trivial to test your lookup methods with sample hbm.xml and  
annotated classes.
Doesn't need any UI setup to verify that.

/max

>>
>>>> btw. that action should be the default for double clicking.
>>>
>>>
>>> Will done.
>>>
>>> It is a pity but I've not found the hibernate-tool.jar source code.
>>> (Even google.com couldn't help me).
>>
>>
>> http://tools.hibernate.org/ the home page of hibernate tools is a good   
>> start ;)
>>
>> There is a link Build and contribute http://www.hibernate.org/268.html   
>> which has the instructions.
>>
>
>



-- 
--
Max Rydahl Andersen
callto://max.rydahl.andersen

Hibernate
max at hibernate.org
http://hibernate.org

JBoss a division of Red Hat
max.andersen at jboss.com




More information about the jbosstools-dev mailing list