-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 
Author Message
 Post subject: Eclipse Plugin issues
PostPosted: Fri Dec 02, 2005 11:47 am 
Newbie

Joined: Fri Nov 21, 2003 5:17 pm
Posts: 9
Location: Oklahoma City, OK, USA
I have WinXP, Eclipse 3.1.1, WTP 0.7.1

Hibernate version: 3.0.5
Name and version of the database you are using: MySQL 5

I have 1 question, 1 suggestion:

1) I'm not a Velocity expert, but I did clone the .vm's and customized them slightly. One thing I can't figure out is how to make the DAO file name be xxxxxDAO.java instead of xxxxxHome.java. I changed the VM to have the class named that, but can't see how to have the file named that.

2) I have the following rev eng file for a new table:
Code:
<hibernate-reverse-engineering>
   <table-filter match-catalog="cpdb" match-name="employeepermission" />
   <table catalog="" name="EmployeePermission">
      <column name="employeeId"/>
      <column name="permissionCode" jdbc-type='' />
      <column name="creationDate" jdbc-type='' />
      <column name="createdBy" jdbc-type='' />
      <column name="permissionId" jdbc-type='' />
   </table>
</hibernate-reverse-engineering>


I would really like for the rev eng process to name the artifacts EmployeePermission.hbm.xml/.java and EmployeePermission.DAO.java not Employeepermission.hbm.xml/.java & Employeepermission.DAO.java. The value should come from the name attribute in <table catalog="" name="EmployeePermission">

Do I need to create a new JIRA entry for a feature request or do you know if one already exists (sorry, haven't gone and dug around)?

Thanks! Like a lot of others have mentioned, the tools have saved a BUNCH of time even though they're still being refined.

Cary


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 12:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
#1 the beta1 of the tools should allow you to do something like:
<hbmtemplate template="dao/daohome.vm" filepattern="{package-name}/{class-name}DAO.java"/>

This is unfortunately only available via ant - im right now sitting trying to find a good way to add the same power to the ui.

#2 your wish is not possible via the beta1, but is now possible in cvs.
you do it by <table name="employeepermission" class="EmployeePermission"/>
(the *name* is used to identify the table, not the class)

If you want it to work with the beta1 tools you will need to write your own ReverseEngineeringStrategy.

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 1:25 pm 
Newbie

Joined: Fri Nov 21, 2003 5:17 pm
Posts: 9
Location: Oklahoma City, OK, USA
I pulled the nightly build from last night and added the class attribute to the table definition. Unfortunately, when I press Ctrl + N, the Hibernate Artifact option is missing from the list in the Hibernate section of the wizard selection. It has Hibernate Configuration File, Hibernate Console Configuration, & Hibernate Reverse Engineering File options. I did open the console and create the SessionFactory before pressing Ctrl + N.

I've seen this behavior in some of the recent nightly builds. Has the way to invoke the rev eng changed or just broken in the nightly builds?

Thanks,
Cary


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 2:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
http://forum.hibernate.org/viewtopic.php?t=950276

there is now a "launcher" - available in the toolbar and menus

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 3:09 pm 
Newbie

Joined: Fri Nov 21, 2003 5:17 pm
Posts: 9
Location: Oklahoma City, OK, USA
I ran the 20051201 nightly build with:
Code:
<table catalog="" name="EmployeePermission" class="EmployeePermissionX"></table>


but it produced objects without the X on the end. Do you think it just didn't get picked up in the nightly build yet?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 3:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no - i think your table is not named "EmployrePermission" but probably "EMPLOYEEPERMISSON"

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 3:28 pm 
Newbie

Joined: Fri Nov 21, 2003 5:17 pm
Posts: 9
Location: Oklahoma City, OK, USA
I'm running MySQL on Linux, so it's case sensitive. I created the table with
CREATE TABLE `EmployeePermission` ( .... ). I changed the value twice for grins:
Code:
<table catalog="" name="employeepermission" class="EmployeePermissionX"></table>

<table catalog="" name="EMPLOYEEPERMISSION" class="EmployeePermissionX"></table>


Neither generated objects with an X in their names. If you tell me a log4j setting that will show helpful info I'll do that and see what it thinks the table name is.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 3:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
just enable debug for org.hibernate and you should see it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 4:29 pm 
Newbie

Joined: Fri Nov 21, 2003 5:17 pm
Posts: 9
Location: Oklahoma City, OK, USA
Well, getting closer...

I ran it with debug enabled. The rev eng saw the table name as EmployeePermission. So I figured it must be the fact that I didn't have a catalog on the table node. I added that and it did generate EmployeePermissionX artifacts. The line looked like:
Code:
<table catalog="cpdb" name="EmployeePermission" class="EmployeePermissionX"></table>


That's the good news.

The bad news is that it put the 3 files in the Output directory and didn't take into account the Package that I have specified. I reran it with this node:
Code:
<table catalog="cpdb" name="EmployeePermission" class="com.axinym.cp.test.EmployeePermissionX"></table>


and it put it into the correct package. Not sure if this is a design decision or a bug. My vote is to have it respect the Package value.

There is one other problem I have. When I run the rev eng, it gets an error if I have the Component Structural Builder enabled that halts it in its tracks:
Code:
!MESSAGE Errors running builder "Component Structural Builder" on project Citizen Portal.
!SUBENTRY 1 org.eclipse.wst.common.modulecore 2 75 2005-12-02 14:25:04.952
!MESSAGE Property not located:IProjectComponentsBuilderDataModelProperties.ADDITIONAL_DEPENDENT_BUILDER_DM_LIST
!STACK 0
java.lang.RuntimeException: Property not located:IProjectComponentsBuilderDataModelProperties.ADDITIONAL_DEPENDENT_BUILDER_DM_LIST
   at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelImpl.checkValidPropertyName(DataModelImpl.java:98)
   at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelImpl.getOwningDataModel(DataModelImpl.java:103)
   at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelImpl.setProperty(DataModelImpl.java:169)
   at org.eclipse.wst.common.componentcore.internal.builder.ProjectComponentsBuilderDataModelProvider.init(ProjectComponentsBuilderDataModelProvider.java:54)
   at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelImpl.init(DataModelImpl.java:69)
   at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelImpl.<init>(DataModelImpl.java:54)
   at org.eclipse.wst.common.frameworks.datamodel.DataModelFactory.createDataModel(DataModelFactory.java:104)
   at org.eclipse.wst.common.componentcore.internal.builder.ComponentStructuralBuilder.build(ComponentStructuralBuilder.java:72)
   at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:593)
   at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
   at org.eclipse.core.runtime.Platform.run(Platform.java:783)
   at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:168)
   at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:202)
   at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:231)
   at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
   at org.eclipse.core.runtime.Platform.run(Platform.java:783)
   at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:234)
   at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:253)
   at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:282)
   at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:211)
   at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:572)
   at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:515)
   at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:733)
   at org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlugin.java:931)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)


I'm going to examine the generated artifacts now to see if they're what I'm expecting.

Thanks,
Cary


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 4:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if cpdb is not listed as your default catalog then yes, this is expected behavior since you might have many EmployeePermission in different catalogs..

If you have specified it in the default catalog hibernate property then it should have found it automatically. Report it in jira as a bug if that is the case.

Regarding the packagename then we probably/maybe could say that if the package name does not have any dot's then you whant the package name prepended....put it in jira and lets see.

I have no idea what the last exception nor builder have against the reverse engineering ;) If you thiink it is the cause of hibernate tools then please put a reproducable testcase/step-by-step into a jira case.

thanks! (and appreciate your persistency - its all good and usefull feedback!)

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.