facebook

DAO Template support

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #246819 Reply

    cdebracy
    Member

    In C:\Program Files\MyEclipse\eclipse\plugins\com.genuitec.eclipse.hibernate_4.1.0\templates I see most of the templates that MyEclipse uses to generate the POJO’s when Hibernate does its thing.

    What I don’t see is the template where the dao is generated. Also, does anyone have a list of variables that are exposed by Velocity for purposes of customizing the generated artifiacts?

    Basically, I want to generate the comments necessary to keep my Checkstyle plug-in happy.

    Thanks,

    Chris

    #246836 Reply

    Riyad Kalla
    Member

    Chris I’ll look intot his for you.

    #246837 Reply

    Brian Fernandes
    Moderator

    Chris,

    That template directory is from our older tools and will be removed.

    http://www.myeclipseide.com/products/eworkbench/public-src/myeclipse_templates_4.1.0.zip
    Zip containing templates current to MyEclipse 4.1. Instructions for how to work with them are in the README in the zip.

    I think that should be all you need to know – but please let us know if you require further assistance,
    Best,
    Brian.

    #247080 Reply

    cdebracy
    Member

    Brian,

    Thanks alot. I’ll check it out.

    Chris

    #247356 Reply

    cdebracy
    Member

    Brian,

    I notice that certain comments and methods should be generated if I’m using jdk5. However, even with the compiler set to 5.0, it’s not generating the generic list support that I see in the DAO templates.

    How do I configure this to generate the correct methods?

    Thanks,

    Chris

    #247358 Reply

    Brian Fernandes
    Moderator

    Chris,

    We have explicitly turned Java 5 generation off since we don’t officially support it yet.

    If you want to try it, edit the template you want JDK 5 support for and at the top, add this line

    
    #set ($jdk5=true)
    

    Let us know how it turns out,
    Best,
    Brian.

    #247367 Reply

    cdebracy
    Member

    Brian,

    When might this support be in place? I’m currently getting this error:

    java.lang.IllegalStateException: expected jdk5 to be bound to false but was to true
    at org.hibernate.tool.hbm2x.TemplateHelper.removeFromContext(TemplateHelper.java:230)
    at org.hibernate.tool.hbm2x.AbstractExporter.cleanUpContext(AbstractExporter.java:201)
    at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:91)
    at org.hibernate.tool.hbm2x.GenericExporter.start(GenericExporter.java:58)
    at com.genuitec.eclipse.hibernate.wizards.MEDAOExporter.start(MEDAOExporter.java:74)
    at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$3.execute(GenerateArtifactsJob.java:342)
    at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
    at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68)
    at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:262)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)

    Thanks,

    Chris

    #247419 Reply

    Brian Fernandes
    Moderator

    Chris,

    We will most likely include JDK5 support in a release post 4.1.1, which is a maintanence release.

    I had no idea there would be a problem resetting the variable. The only suggestion I can make is to replace all instances of $jdk5 in your template to something else.. $cjdk perhaps and set that to true instead. Then you won’t be messing with a preset variable, and Velocity won’t have a problem.

    Sorry for the inconvenience caused, but we still need to beef up JDK5 support until which point we don’t intend to support it at a UI level.

    Let me know if you have further issues,
    Best,
    Brian.

    #247429 Reply

    cdebracy
    Member

    Brian,

    Thanks for the info. Do you have a timeframe for the 4.1.1 maintenance release?

    Chris

    #247431 Reply

    Brian Fernandes
    Moderator

    Chris,

    Sorry for my confusing sentence above. 4.1.1 is due sometime this week, but will not include JDK 5 support as it is a maintanence release.
    We will look at supporting JDK 5 only after 4.1.1.

    Best,
    Brian.

    #247432 Reply

    cdebracy
    Member

    Brian,

    Ah, missed the “post” 4.1.1 comment. I’ve manually added generics and comments so I’ll test those.

    Thanks,

    Chris

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: DAO Template support

You must be logged in to post in the forum log in