-->
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.  [ 133 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9  Next
Author Message
 Post subject:
PostPosted: Sun Sep 11, 2005 10:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
my classloading issues were with the WAR not being able to see my hibernate.jar when running in tomcat...didn't have time to investigate much.

I seriously doubt that the class name of the class will be put in the generator - are you sure that is happening ?

what if you just run jdbconfiguration with cfg2hbm and not hbm2jsf ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 11, 2005 11:39 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
Still getting the same behavior when I run the following target:

Code:
   <target name="artifactgeneration2" depends="clean" >
      <mkdir dir="src" />
      
      <hibernatetool destdir="src">
         <jdbcconfiguration configurationfile="hibernate.bootstrap.hbm.xml"
            revengfile="reveng.xml"
            packagename="net.dbyrne.demo" />
         <cfg2hbm />
        </hibernatetool>
   </target>


If I remove revengfile="reveng.xml" everything is fine. Here is reveng.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

<hibernate-reverse-engineering>
   <table-filter match-name="pg_logdir_ls" exclude="true" />
</hibernate-reverse-engineering>


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 11, 2005 12:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm, we must have a bug.

could you put it in jira so i wont forget to check it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: AndroMDA cartridge
PostPosted: Sun Sep 18, 2005 5:28 pm 
Newbie

Joined: Sun Apr 24, 2005 11:43 pm
Posts: 8
You could look into creating a cartridge for AndroMDA.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 18, 2005 5:46 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
AFAIK andromeda already generates .hbm.xml so what else is needed ?

The reason we dont focus our work around some 3dr party high level codegeneration tool is that we find that the mapping model in hibernate is very rich and for all most all cases exactly what you need for good codegeneration....plus we dont want to require to many layers of setup etc. just to perform simple codegeneration.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 11:11 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
Max, can you tell me how far we got today? Where you say "makes the jsf part" in the JIRA, do you mean you were able to deploy the app and manage persistent objects?

As far as the output goes, here are a few things. There are currently 5 things generated for each class. For example, a Customer gets a CustomerConverter, CustomerBackendCrudBean, CustomerLister, and Customer JSP and a CustomerLister JSP . This however will change when all Converters, all BackendCrudBeans and all Listers are collapsed into a GenericConverter, a GenericBackendCrudBean and a GenericLister . The JSPs will be the only things generated per-class, and most of the java will just pass through the velocity engine untransformed. The GenericLister and the GenericManagedCrudBean delegates all DA to a GenericDAO (not directly to a HiberenateUtil) that is declaratively injected by the controller .

Code:
   <managed-bean>
        <managed-bean-name>customerCrudBacker</managed-bean-name>
        <managed-bean-class>com.foo.GenericCrudBacker</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>   
      <managed-property>
            <property-name>dao</property-name>
            <value>#{DAOFactory.customerDAO}</value>
        </managed-property>             
    </managed-bean>


I've made this work on a project - marginal increase in XML LOC and massive decrease in java LOC.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 4:49 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and what doees the GenericX uses to do this ? Introspection of Configuration/Classmetadata ? Or is it simply the jdk 1.5 dao usage that are in the works here ?

What I did for the patch were simply to make it use the new stuff we have (POJOClass instead of c2j all the time).

And I also made some attempt to make it use the existing velocity generation code instead of having yet-another runVelocity method ;)

Some of generated code seemed pretty "crude" to me but I guess that is just work in progress as you say ;)

p.s. have you looked at Seam ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 12:24 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
max wrote:
and what doees the GenericX uses to do this ? Introspection of Configuration/Classmetadata ? Or is it simply the jdk 1.5 dao usage that are in the works here ?


The JSF controller wires the methods of GenericCrudX to events using reflection - dependency injection is used to make each bean know who,what,where and when. You can certianly use DAOs that are pre1.5, but it's not as pretty. H meta data is only needed at generation time.

There are some folks talking about Seam here, and I'm sure we'll argue back and forth over it in meetings in a month or two. hbm2seam is similar to a long term goal/fantasy I have called hbm2ear ... but one thing at a time ;-)

I will clean up the velocity this weekend.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 23, 2005 2:52 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
Can someone please make Hbm2DAOGeneratorTask extend Hbm2JavaGeneratorTask before someone on the forum complains about @ejb and @generics not working ? Also, the generated logging constructor in daohome.vm is still missing "Home" .


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 23, 2005 3:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
now committed - would prefer to have that in the jira and not in the forum

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 23, 2005 4:01 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
http://opensource2.atlassian.com/projects/hibernate/browse/HBX-367#action_19861

Yes, I said "POJOExporter" when I was really thinking Hbm2JavaGeneratorTask .


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 24, 2005 4:42 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
homey ...

I'm getting this w/ hbm2java .

Code:
[hibernatetool] WARNING: org.apache.velocity.runtime.exception.ReferenceException: reference : template = pojo/Pojo.vm [line 3,column 1] : $secondpassclassimports is not a valid reference.


maybe it's related to this in POJOExporter.createDefaultContext() :

Code:
initialContext.put("secondclassimports", "$secondpassclassimports");


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 24, 2005 6:35 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
why does it complain when it is actually in the context ?

and it does work as epxected so weird..

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 24, 2005 7:29 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
It goes away if I change "secondclassimports" in the java to "secondpassclassimports" ... didn't have time to look at it in depth.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 25, 2005 1:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hm ok. weird that the unittests passes...

_________________
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.  [ 133 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9  Next

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.