[teiid-dev] Hibernate reverse engineering
Michael Walker
michael.walker at amentra.com
Tue Mar 23 14:18:14 EDT 2010
John,
I'm actually having issues getting this working with Teiid 6.2 and JBoss Tools; maybe it's easy for you to tell what I'm doing wrong here, since you've got it working.
First, I've added the teiid-dialect to the JDK global classpath as you've previously mentioned. Also, on my project build path, I added the teiid-6.2.0-jdbc driver.
Next, I created a config file with the appropriate values (driver, dialect, url, username, password). I did not define a default schema or catalog, and did not give the session factory a name.
Then, I created a Hibernate console configuration, which uses the previously-defined config file, and specifies that the Teiid dialect should be used.
When I try to expand the "Database" tab, it tells me that it can't find the Teiid dialect. So, I added the dialect to the project classpath as well. After that addition, the "Database" tab fails silently, with no error in the error log or console.
I repeated the same process with Oracle, and it succeeded.
Also, I've confirmed that Teiid is running, the JDBC driver is in the classpath, and the values are correct by running a simple JDBC test client in the same project. The code is able to establish a connection and execute some sample queries against Teiid.
Do you see anything obvious I'm missing here? Thanks.
________________________________________
From: John Doyle [jdoyle at redhat.com]
Sent: Friday, March 19, 2010 3:53 PM
To: Michael Walker
Cc: teiid-dev at lists.jboss.org; Jason Stokes; Ted Jones
Subject: Re: [teiid-dev] Hibernate reverse engineering
Mike,
I got this to work in JBoss Tools, I'm sure there it can be done in the ant tasks as well. I need to follow up with Max to see if there is a more correct way to do this, but if you add the teiid dialect that is delivered in the client directory of Teiid to the global eclipse classpath, reveng works.
In JBoss Tools navigate to Window->Preferences->Java->Installed JRE's. Select the current JRE and click the Edit button. Click Add External Jar and navigate to the teiid-hibernate-dialect jar.
~jd
----- "Ted Jones" <tejones at redhat.com> wrote:
> FWIW, I was able to reverse engineer using JBossTools 2.0.1 and Teiid
> 6.2. This was before the Teiid dialect was added to JBossTools. I
> documented the process here:
> http://community.jboss.org/wiki/RESTEasywithTeiid. The workaround I
> had to use do to the absence of the Teiid Hibernate dialect should
> work for the latest JBossTools as well. My example involved creating a
> SEAM web app, but that shouldn't be a requirement to get the Hibernate
> objects created
>
> Ted
>
> ----- Original Message -----
> From: "Amentra" <michael.walker at amentra.com>
> To: "Ramesh Reddy" <rareddy at redhat.com>
> Cc: teiid-dev at lists.jboss.org, "Jason Stokes"
> <jason.stokes at amentra.com>
> Sent: Thursday, March 18, 2010 9:08:37 PM GMT -06:00 US/Canada
> Central
> Subject: Re: [teiid-dev] Hibernate reverse engineering
>
> It is typically run as an ant task, and behavior is tweaked via a
> config file.
>
>
>
> On Mar 18, 2010, at 3:15 PM, Ramesh Reddy <rareddy at redhat.com> wrote:
>
> > Does Hibernate support command line reverse engineering?
> >
> > On Thu, 2010-03-18 at 16:26 -0500, Michael Walker wrote:
> >> Thanks John. Let me know the JIRA and I'll follow it. I agree that
> >> this seems like something we should be capable of currently.
> >>
> >>
> >>
> >>
> ______________________________________________________________________
>
>
> >> From: John Doyle [jdoyle at redhat.com]
> >> Sent: Thursday, March 18, 2010 5:16 PM
> >> To: Michael Walker
> >> Cc: Jason Stokes; teiid-dev at lists.jboss.org
> >> Subject: Re: [teiid-dev] Hibernate reverse engineering
> >>
> >>
> >>
> >> Hey Mike,
> >>
> >> I just tried to reverse engineer a 6.2 teiid vdb, because I
> thought
> >> your central thrust here was incorrect and that we had everything
> we
> >> needed already, and it fails. The tooling can't find our dialect.
> >> It's in all the lists, but the classes are not getting found.
> >>
> >> I believe this to be a defect, and that with the latest release of
> >> JBossTools you should be able to reverse engineer a Teiid VDB.
> I'll
> >> see about tracking down the issue and logging a Jira.
> >>
> >> ~john
> >> ----- "Michael Walker" <michael.walker at amentra.com> wrote:
> >>>
> >>> To set the context: Hibernate's reverse engineering feature uses
> >> standard JDBC database metadata to automatically generate all the
> >> necessary Hibernate config files for working with the target
> database
> >> in an O/R fashion
> >>
> (https://www.hibernate.org/hib_docs/tools/reference/en/html/reverseengineering.html
>
> >> ).
> >>>
> >>> The getting started guide tells me that Teiid does not currently
> >> support reverse engineering via Hibernate. This is somewhat
> >> surprising, since Teiid generally supports all the typical JDBC
> >> database metadata, making it easy to connect third-party client
> >> tools,
> >> etc.
> >>>
> >>> Does anyone on the Teiid development team know what it would take
> to
> >> extend support for reverse engineering? How far off are we here?
> >>>
> >>> Apparently, Hibernate does provide a few options for working with
> >> non-standard sources:
> >>>
> >>> 1. Create a custom hibernate.reveng.xml configuration file - This
> >> will take care of small issues such as type mismatches, or
> exclusion
> >> of certain tables
> >>> 2. Extend Hibernate's JDBCMetaDataDialect class with your own
> >> implementation
> >>>
> >>> I wonder if either option would allow us to get reverse
> engineering
> >> working with Teiid without having to make significant change to
> Teiid
> >> source. Thoughts?
> >>>
> >>>
> >>>
> >>>
> >>
> >>> _______________________________________________ teiid-dev mailing
> >> list teiid-dev at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/teiid-dev
> >> _______________________________________________
> >> teiid-dev mailing list
> >> teiid-dev at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/teiid-dev
> >
> _______________________________________________
> teiid-dev mailing list
> teiid-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/teiid-dev
> _______________________________________________
> teiid-dev mailing list
> teiid-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/teiid-dev
More information about the teiid-dev
mailing list