middlegen r5
hbm2dll error: table without primary key
i like to mapping composite-id without other class.........
the table has no primary key , so it mapping as
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin 2.1
http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->
<class
name="org.ctais.hibernate.DmZsxm"
table="DM_ZSXM"
>
<composite-id>
<key-property
name="zsxmDm"
column="ZSXM_DM"
type="java.lang.String"
length="2"
/>
<key-property
name="zsxmMc"
column="ZSXM_MC"
type="java.lang.String"
length="30"
/>
<key-property
name="zsxmJc"
column="ZSXM_JC"
type="java.lang.String"
length="10"
/>
<key-property
name="xybz"
column="XYBZ"
type="java.lang.String"
length="1"
/>
</composite-id>
<!-- Associations -->
<!-- derived association(s) for compound key -->
<!-- end of derived association(s) -->
</class>
</hibernate-mapping>
[schemaexport] (cfg.Binder 230 ) Mapping class: org.cta
is.hibernate.DjNsrxxKz -> DJ_NSRXX_KZ
[schemaexport] (cfg.Configuration 169 ) Mapping file: D:\Progr
am Files\Middlegen-Hibernate-r5\build\gen-src\org\test\hibernate\DmZspm.hbm.xml
[schemaexport] (cfg.Binder 230 ) Mapping class: org.cta
is.hibernate.DmZspm -> DM_ZSPM
[schemaexport] (cfg.Configuration 255 ) Could not compile the
mapping document
[schemaexport] net.sf.hibernate.MappingException: composite-id class must overri
de equals(): org.ctais.hibernate.DmZspm
[schemaexport] at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:306)
[schemaexport] at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1257)
[schemaexport] at net.sf.hibernate.cfg.Configuration.add(Configuration.java:252
)
[schemaexport] at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java
:174)
[schemaexport] at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getConfigurati
on(SchemaExportTask.java:195)
[schemaexport] at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(Schema
ExportTask.java:135)
[schemaexport] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:275)
[schemaexport] at org.apache.tools.ant.Task.perform(Task.java:364)
[schemaexport] at org.apache.tools.ant.Target.execute(Target.java:341)
[schemaexport] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[schemaexport] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[schemaexport] at org.apache.tools.ant.Project.executeTargets(Project.java:1062
)
[schemaexport] at org.apache.tools.ant.Main.runBuild(Main.java:673)
[schemaexport] at org.apache.tools.ant.Main.startAnt(Main.java:188)
[schemaexport] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
[schemaexport] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
[schemaexport] (cfg.Configuration 178 ) Could not configure da
tastore from file: D:\Program Files\Middlegen-Hibernate-r5\build\gen-src\org\cta
is\hibernate\DmZspm.hbm.xml
[schemaexport] net.sf.hibernate.MappingException: composite-id class must overri
de equals(): org.test.hibernate.DmZspm
[schemaexport] at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:306)
[schemaexport] at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1257)
[schemaexport] at net.sf.hibernate.cfg.Configuration.add(Configuration.java:252
)
[schemaexport] at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java
:174)
[schemaexport] at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getConfigurati
on(SchemaExportTask.java:195)
[schemaexport] at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(Schema
ExportTask.java:135)
[schemaexport] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:275)
[schemaexport] at org.apache.tools.ant.Task.perform(Task.java:364)
[schemaexport] at org.apache.tools.ant.Target.execute(Target.java:341)
[schemaexport] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[schemaexport] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[schemaexport] at org.apache.tools.ant.Project.executeTargets(Project.java:1062
)
[schemaexport] at org.apache.tools.ant.Main.runBuild(Main.java:673)
[schemaexport] at org.apache.tools.ant.Main.startAnt(Main.java:188)
[schemaexport] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
[schemaexport] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
BUILD FAILED
D:\Program Files\Middlegen-Hibernate-r5\build.xml:264: Schema text failed: net.s
f.hibernate.MappingException: composite-id class must override equals(): org.test.hibernate.DmZspm
Total time: 26 seconds