-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate-Tools: ReverseEngineeringStrategy
PostPosted: Mon Sep 04, 2006 8:04 am 
Regular
Regular

Joined: Sat May 20, 2006 3:49 am
Posts: 78
Hello,

I have a problem with my ReverseEngineeringStrategy. When I try to build the POJOs with the Hibernate-Tools, I get the error:
Code:
org.hibernate.console.HibernateConsoleRuntimeException: Could not create or find org.granitic.steinlaus.base.ModelReverseEngingeeringStrategy with one argument delegate constructor
  java.lang.ClassNotFoundException: org.granitic.steinlaus.base.ModelReverseEngingeeringStrategy
    java.lang.ClassNotFoundException: org.granitic.steinlaus.base.ModelReverseEngingeeringStrategy

My ReverseEngineeringStrategy:
Code:
package org.granitic.steinlaus.base;

import java.util.Properties;

import org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy;
import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
import org.hibernate.cfg.reveng.TableIdentifier;


public class ModelReverseEngingeeringStrategy extends
        DelegatingReverseEngineeringStrategy {

    public ModelReverseEngingeeringStrategy(final ReverseEngineeringStrategy delegate) {
        super(delegate);
    }

    /* (non-Javadoc)
     * @see org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy#columnToPropertyName(org.hibernate.cfg.reveng.TableIdentifier, java.lang.String)
     */
    @Override
    public String columnToPropertyName(TableIdentifier arg0, String arg1) {
        if (arg1.equals("USER_CRE")) {
            return "userCre";
        } else if (arg1.equals("USER_UPD")) {
            return "userUpd";
        } else {
            return super.columnToPropertyName(arg0, arg1);
        }
    }

    /* (non-Javadoc)
     * @see org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy#getTableIdentifierProperties(org.hibernate.cfg.reveng.TableIdentifier)
     */
    @Override
    public Properties getTableIdentifierProperties(TableIdentifier arg0) {
        System.out.println(arg0.getName());
        return super.getTableIdentifierProperties(arg0);
    }
}

I can't imagine why it doesn't work. I have searched a lot in this forum and in the JBoss forum, but havn't found any solution.

Any ideas?

I'm using Hibernate-Tools 3.2.0-beta6a.

Is it possible to add annotations to a method with a custom ReverseEngineeringStrategy?

Regards,

Christoph


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 04, 2006 8:53 am 
Newbie

Joined: Wed Jul 19, 2006 4:05 am
Posts: 13
Hi,

Add your src folder where is located your custom strategy to the classpath of the used Hibernate Console Configuration.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 04, 2006 2:41 pm 
Regular
Regular

Joined: Sat May 20, 2006 3:49 am
Posts: 78
zero wrote:
Hi,

Add your src folder where is located your custom strategy to the classpath of the used Hibernate Console Configuration.


Ok, thanks, that helped!


Top
 Profile  
 
 Post subject: Re: Hibernate-Tools: ReverseEngineeringStrategy
PostPosted: Mon May 23, 2011 3:49 am 
Newbie

Joined: Fri May 20, 2011 3:41 am
Posts: 5
Hello all,

another post I found about adding annotations with ReverseEngineeringStrategy that doesn't have an answer yet :)

So I ask again the question that maitscha asked :
maitscha wrote:
(...)
Is it possible to add annotations to a method with a custom ReverseEngineeringStrategy?
(...)


Best regards,

Cédric.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.