-->
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.  [ 6 posts ] 
Author Message
 Post subject: hbm2hbmxml
PostPosted: Tue Aug 02, 2011 3:21 pm 
Newbie

Joined: Tue Aug 02, 2011 2:58 pm
Posts: 3
HI, I am getting the following error when I am trying to run the pom file bellow:
Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:2.2:hbm2hbmxml (hbm2hbmxml) on project hibernate_reverese_enjenering: Execution hbm2hbmxml of goal org.codehaus.mojo:hibernate3-maven-plugin:2.2:hbm2hbmxml failed: Duplicate class name 'CheckConstraints' generated for 'org.hibernate.mapping.Table(Alla.sys.check_constraints)'. Same name where generated for 'org.hibernate.mapping.Table(Alla.sys.check_constraints)' -> [Help 1]
What I am doing wrong? Your help will be very much appreciated. thanks

here it is a table definition:
USE [Alla]
GO
/****** Object: Table [dbo].[roles] Script Date: 08/02/2011 13:09:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[roles](
[role_id] [numeric](18, 0) IDENTITY(1,1) NOT NULL,
[role_name] [varchar](50) NULL,
CONSTRAINT [PK_roles] PRIMARY KEY CLUSTERED
(
[role_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF


hibernate.properties

hibernate.dialect = org.hibernate.dialect.SQLServerDialect

#hibernate.connection.driver_class = com.microsoft.sqlserver.jdbc.SQLServerDriver
hibernate.connection.driver_class = net.sourceforge.jtds.jdbc.Driver
#hibernate.connection.url = jdbc:sqlserver://localhost:1433;databaseName=Alla
hibernate.connection.url = jdbc:jtds:sqlserver://localhost:1433;User=sa;Password=tiger123;DatabaseName=Alla;SelectMethod=cursor

hibernate.connection.username = sa
hibernate.connection.password= tiger123

hibernate.reveng.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
<hibernate-reverse-engineering>
<table-filter match-catalog="Alla" match-schema="dbo" match-name="roles"/>
<!-- <table-filter match-catalog="Alla" match-schema="dbo" match-name="user_role"/>
<table-filter match-catalog="Alla" match-schema="dbo" match-name="users"/>
-->
</hibernate-reverse-engineering>

Here it is my pom file:
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>japa_maven</artifactId>
<groupId>main</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>main</groupId>
<artifactId>hibernate_reverese_enjenering</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>hibernate_reverese_enjenering</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution> <id>hbm2hbmxml</id>
<phase>generate-sources</phase>
<goals>
<goal>hbm2hbmxml</goal>
</goals> <configuration> <components> <component>
<name>hbm2hbmxml</name> <outputDirectory>src/main/resources</outputDirectory>
</component> </components> </configuration> </execution>
</executions>
<dependencies>
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>1.2.4</version>

</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>


</dependencies>



<!-- <dependencies> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derbyclient</artifactId>
<version>10.4.2.0</version> </dependency> </dependencies> -->
</project>


Top
 Profile  
 
 Post subject: Re: hbm2hbmxml
PostPosted: Wed Aug 03, 2011 4:54 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
This means reverse engineering process got 2 tables from database and gave them the same name: CheckConstraints. But the problem it is the table with the same name, shcema, catalog. May be you have a view with the same name? Or Table with the same name but in different case (uppercase)?


Top
 Profile  
 
 Post subject: Re: hbm2hbmxml
PostPosted: Thu Aug 04, 2011 7:31 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
Ah, the problem is that you didn't specify default schema and have the same table name in other schema.


Top
 Profile  
 
 Post subject: Re: hbm2hbmxml
PostPosted: Thu Aug 04, 2011 11:38 am 
Newbie

Joined: Tue Aug 02, 2011 2:58 pm
Posts: 3
NO, this is a test database, I have only 4 tables in there, users, roles, user_role, test. the view that the tool is complaining about is a system view:sys.check_constraint
I do not have any tables with such name and I do not have any views.

I guess, I could have specify the list of the tables that I am interested in for the xml generation ( to leave system views alone), but I do not know how to do that. So I would greatly appreciate if you would let me know how to do that.
However, I thought that I need to report the issue, since error message should not be generated for system views.

thanks for your help.


Top
 Profile  
 
 Post subject: Re: hbm2hbmxml
PostPosted: Thu Aug 04, 2011 11:41 am 
Newbie

Joined: Tue Aug 02, 2011 2:58 pm
Posts: 3
I forgot to mention that I have only one schema: Alla
thanks


Top
 Profile  
 
 Post subject: Re: hbm2hbmxml
PostPosted: Fri Aug 05, 2011 8:55 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
Alla is catalog, dbo is schema


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