This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | "Hibernate Mapping Files and POJOs from Database"-Wizard does not generate any relationship-mappings in hbm.xml nor entity classes | ||
---|---|---|---|
Product: | javaee | Reporter: | markiewb |
Component: | Hibernate | Assignee: | Sergey Petrov <sj-nb> |
Status: | NEW --- | ||
Severity: | normal | CC: | jskrivanek, pjiricka |
Priority: | P2 | ||
Version: | 7.1 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: | Shows the error and the expectations as comments |
Description
markiewb
2012-12-09 08:41:25 UTC
Created attachment 129097 [details]
Shows the error and the expectations as comments
I'm not sure it was expected to work, current POJOs represent tables without any relationships information, even if ejb3/java5 options are not selected. yes, it's specified in test spec and I may need to try if it used to work at least in 7.1. (In reply to comment #2) > I'm not sure it was expected to work, current POJOs represent tables without > any relationships information, even if ejb3/java5 options are not selected. > yes, it's specified in test spec and I may need to try if it used to work at > least in 7.1. What is the Java 5 options for? I expected generics-stuff like "List<Product> getProducts()" but this induces the modelling of relationships... from help JDK 5 Language Features. When selected the generated code will take advantage of Java language features such as generics and static imports that are supported by JDK 5. EJB 3 Annotations. When selected the generated POJOs use annotations for mapping information. in case if there was any relationship without generics it should start to use generics, but as I see and it's tested in 7.1 also (spec version) it wasn't implemented. current behavior seems to be 'by design', as manufactorer isn't missed but is used as usual field. for example in jpa area it's one of generation options to use fields for fk if relationships is missed (in cas of hibernate it's permanent strategy) I afraid it need to be resolved either as won't fix or as enhancement as it works in some way now, and it was created this way and seems to be the same always(as far as I can see from investigation since 7.1) and support level for the area may not be enough to implement in this/next release, but this really looks like a missed feature. I am an old user of netbeans and i did the book author example in which the relationship was generating properly using Oracle DB. But Now I need to work again with hibernate using Derby db, the relationship in pojo are not generated. I did perform with some other schema as well and it was working perfectly fine, I am not sure if it is due to change of the database from oracle to derby or change in netbeans version, currently I am using 6.9.1, 7.2 , and 8 but no luck. What I am missing I am not sure, someone might guide me. My experience is similar to mannan4net@netbeans.org's. I'm using NetBeans 8.1 and the wizard appears to work perfectly on the MySQL sakila example database. But with the Derby sample database, no relationships get generated. What's more, I can't even seem to force the issue. I tried adding this <table> tag to my .reveng.xml: <table name="PURCHASE_ORDER"> <foreign-key foreign-table="CUSTOMER" constraint-name="FK_PO_CUST"> <column-ref foreign-column="CUSTOMER_ID" local-column="CUSTOMER_ID"/> <many-to-one property="customerId"/> </foreign-key> </table> The wizard ignored it completely, giving no error messages and generating the same PurchaseOrder.java and PurchaseOrder.hbm.xml as when the tag wasn't there. |