[hibernate-issues] [Hibernate-JIRA] Resolved: (HBX-1049) No class generated for tables with only PK columns

Max Rydahl Andersen (JIRA) noreply at atlassian.com
Wed Mar 12 04:08:33 EDT 2008


     [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-1049?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Max Rydahl Andersen resolved HBX-1049.
--------------------------------------

    Resolution: Rejected

if it only has PKS and they are all FKs to other tables then it is a many-to-many table and is mapped as such.

you can disable many-to-many detection if you dont want that to happen - see the docs.

> No class generated for tables with only PK columns 
> ---------------------------------------------------
>
>                 Key: HBX-1049
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1049
>             Project: Hibernate Tools
>          Issue Type: Bug
>          Components: hbm2java
>    Affects Versions: 3.2.0.GA
>         Environment: MS SQL Server 2005 Express Edition, Sun JDK 1.5.0_15, Sun Solaris Sparc 10.
> Hibernate Tools 3.2.0 GA.
>            Reporter: Frank Langelage
>
> See http://forum.hibernate.org/viewtopic.php?p=2379128#2379128.
> Inside my database the are some tables containing only PK fields, nothing else.
> Both PK fields are also FK to different tables.
> Example SQL:
> CREATE TABLE [dbo].[BOMConfiguratorBOMTypes](
> 	[bomcCode] [varchar](20) NOT NULL,
> 	[bomtCode] [char](2) NOT NULL,
>  CONSTRAINT [PK_BOMConfiguratorBOMTypes_bomcCode_bomtCode] PRIMARY KEY CLUSTERED 
> (
> 	[bomcCode] ASC,
> 	[bomtCode] ASC
> )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
> ) ON [PRIMARY]
> ALTER TABLE [dbo].[BOMConfiguratorBOMTypes]  WITH CHECK ADD  CONSTRAINT [FK_BOMConfiguratorBOMTypes_BOMConfigurators] FOREIGN KEY([bomcCode])
> REFERENCES [dbo].[BOMConfigurators] ([bomcCode])
> ON UPDATE CASCADE
> GO
> ALTER TABLE [dbo].[BOMConfiguratorBOMTypes] CHECK CONSTRAINT [FK_BOMConfiguratorBOMTypes_BOMConfigurators]
> GO
> ALTER TABLE [dbo].[BOMConfiguratorBOMTypes]  WITH CHECK ADD  CONSTRAINT [FK_BOMConfiguratorBOMTypes_BOMTypes] FOREIGN KEY([bomtCode])
> REFERENCES [dbo].[BOMTypes] ([bomtCode])
> ON UPDATE CASCADE
> Hibernate Tools does not generate a class for it.
> As soon as I add an additional column to such a table the class gets generated.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list