- This topic has 13 replies, 3 voices, and was last updated 19 years, 3 months ago by support-michael.
-
AuthorPosts
-
xzy_loveMember<?xml version=”1.0″ encoding=’UTF-8′?>
<!DOCTYPE hibernate-mapping PUBLIC
“-//Hibernate/Hibernate Mapping DTD 2.0//EN”
“http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd” ><!– DO NOT EDIT: This is a generated file that is synchronized –>
<!– by MyEclipse Hibernate tool integration. –>
<!– Created Tue Aug 16 16:26:10 CST 2005 –>
<hibernate-mapping package=”com.chinabach.trip.center.pojo”><class name=”OrderRoomInfo” table=”ORDER_ROOM_INFO”>
<property name=”orederRoomId” column=”OREDER_ROOM_ID” type=”java.lang.String” not-null=”true” />
<property name=”hotelhomeId” column=”HOTELHOME_ID” type=”java.lang.String” />
<property name=”orderId” column=”ORDER_ID” type=”java.lang.String” />
<property name=”quantity” column=”QUANTITY” type=”java.lang.Long” />
<property name=”persons” column=”PERSONS” type=”java.lang.Long” />
<property name=”addBed” column=”ADD_BED” type=”java.lang.String” />
<property name=”inDate” column=”IN_DATE” type=”java.lang.String” />
<property name=”outDate” column=”OUT_DATE” type=”java.lang.String” />
<property name=”comeWay” column=”COME_WAY” type=”java.lang.String” />
<property name=”lastTime” column=”LAST_TIME” type=”java.lang.String” />
<property name=”price” column=”PRICE” type=”java.lang.String” />
</class></hibernate-mapping>
this file is generated by M3 from database table.why the PK is not generated ??????
support-michaelKeymasterWhat database did you use to generate this mapping file?
xzy_loveMemberthe database is oracle
when generate mapping file,some mapping file is right,some mapping file is wrong.
xzy_loveMemberthe database is oracle 9.2
support-michaelKeymasterCan you post the DDL for 1 or more of the tables for which mapping file generation is dorking up? Please note that the MyEclpse portal software is hyper-senstivite to direct DDL content so please change all statements to something like the following before submitting:
CREATE TAB*E ...
xzy_loveMembereclipse3.01+myeclipse3.82 is ok
but eclipse3.1+myeclipse4.0M3 is wrong
Brian FernandesModeratorxyz,
You said it was working in 3.0.1 + 3.82 – did you mean MyEclipse 3.8.2 or MyEclipse 3.8.4? Can you check right now in that version of MyEclipse whether the hibernate mapping is generated as expected, maybe your Table structure has changed since you tried in 3.8.4?
In 4.0M3, select the table in the DB Browser, can you see the primary key listed in the Primary Key tab in the Table Info view? Can you try other tables and see if the hibernate mapping is generated correctly for them – can you see their Primary Key details in the Table Info view?
If you can paste your DDL here for us as Michael requested above, that would really help tracking this down.
Best,
Brian.
xzy_loveMemberIn 4.0M3,I select the table in the DB Browser, I can see the primary key listed in the Primary Key tab in the Table Info view. some hibernate mapping is generated correctly ,some is wrong ,in the wrong mapping file,the Primary key was as a property
<?xml version=”1.0″ encoding=’UTF-8′?>
<!DOCTYPE hibernate-mapping PUBLIC
“-//Hibernate/Hibernate Mapping DTD 2.0//EN”
“http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd” ><!– DO NOT EDIT: This is a generated file that is synchronized –>
<!– by MyEclipse Hibernate tool integration. –>
<!– Created Tue Aug 16 16:26:10 CST 2005 –>
<hibernate-mapping package=”com.chinabach.trip.center.pojo”><class name=”OrderRoomInfo” table=”ORDER_ROOM_INFO”>
<property name=”orederRoomId” column=”OREDER_ROOM_ID” type=”java.lang.String” not-null=”true” />
<property name=”hotelhomeId” column=”HOTELHOME_ID” type=”java.lang.String” />
<property name=”orderId” column=”ORDER_ID” type=”java.lang.String” />
<property name=”quantity” column=”QUANTITY” type=”java.lang.Long” />
<property name=”persons” column=”PERSONS” type=”java.lang.Long” />
<property name=”addBed” column=”ADD_BED” type=”java.lang.String” />
<property name=”inDate” column=”IN_DATE” type=”java.lang.String” />
<property name=”outDate” column=”OUT_DATE” type=”java.lang.String” />
<property name=”comeWay” column=”COME_WAY” type=”java.lang.String” />
<property name=”lastTime” column=”LAST_TIME” type=”java.lang.String” />
<property name=”price” column=”PRICE” type=”java.lang.String” />
</class></hibernate-mapping>
the ‘orederRoomId’ is the primary key .
support-michaelKeymasterIn order for us to isolate the behavior you are seeing we need to have the DDL for the ORDER_ROOM_INFO table that the mapping file was derived. Please provide that info and we should be able to resolve this issue quickly.
xzy_loveMemberbecome I can’t post the code,can you give me your email;I email it to you
support-michaelKeymastersupport@genuitec.com – please include the title of this thread
support-michaelKeymasterThanks for send the DDL as it allowed me to quickly setup a test on an Oracle 9.2 server. Unfortunately I am not able to replicate the problem you have identified using the MyEclipse Hibernate Reverse-engineering Mapping Wizard. What identity method are you specifying in this wizard?
You mentioned your problem is with M3. Do you have non-MyEclipse plugins running?
<hibernate-mapping package="com.bar"> <class name="OrderRoomInfo" table="ORDER_ROOM_INFO"> <id name="orederRoomId" column="OREDER_ROOM_ID" type="string"> <generator class="hilo"/> </id> <property name="hotelhomeId" column="HOTELHOME_ID" type="string" /> .....
xzy_loveMemberif you use the MyEclipse Hibernate Reverse-engineering Mapping Wizard to this table only,it is ok,but when use it to many table in one time,you will know that some is ok,some is not ok.
support-michaelKeymasterI’m not able to replicate the problem you describe. As an example I just generated POJO mappings for the entire Oracle HR example scheme by selecting every table and launching the rev-eng mapping wizard. Every table with a PK had a corresponding mapping file generated with the proper <id> element.
The problem you describe does not sound like MyEclipse related but we need to confirm. If you have this schema available can you try an experiment and generate mappings for it to see if the problem is with your schema or with MyEclipse?
Finally I asked in an earlier reply if you have other plugins installed in addition to MyEclipse. Can you provide this information?
-
AuthorPosts