- This topic has 16 replies, 7 voices, and was last updated 18 years, 3 months ago by aharvey.
-
AuthorPosts
-
hsalamehMemberHi all
I am trying out myEclipse, and Specifically the hibernate functionality.
I saw how you can reverse engineer a database and the Java classes are generated automatically,
but how do i do it the other way around.
I have some POJO classes that i would like to persist in a database.
I can’t find something in myEclipse to help me do that automatically.
Any help is greatly appreicated.
Haris PecoMemberhsalameh ,
You have to have xdoclet or ejb3 annotations for mapping POJO to database.There isn’t posibility mapping pure POJO to database (there isn’t enough information)
MyEclipse will support ejb3 in future releases and you will use xdoclet alreadyBest regards
hsalamehMember@support-snpe wrote:
hsalameh ,
You have to have xdoclet or ejb3 annotations for mapping POJO to database.There isn’t posibility mapping pure POJO to database (there isn’t enough information)
MyEclipse will support ejb3 in future releases and you will use xdoclet alreadyBest regards
I am aware that you need annotations for mapping, and i am aware that there is also an xml mapping file too.
My question is whether myEclipse has tools (wizards) that automatically create the xml mappings (or the annotations for that matter). I am aware that the process cannot be totally automatic, but I hope there is some sort of wizard that makes it easier or automates a good part of it.thanks for any help.
Haris PecoMemberMy question is whether myEclipse has tools (wizards) that automatically create the xml mappings (or the annotations for that matter). I am aware that the process cannot be totally automatic, but I hope there is some sort of wizard that makes it easier or automates a good part of it.
No, there isn’t enough information for mapping pure POJO to database.
For example, there isn’t column type, length and you have to add this information.
What you expect that MyEclipse can do ?Best regards
hsalamehMember@support-snpe wrote:
No, there isn’t enough information for mapping pure POJO to database.
For example, there isn’t column type, length and you have to add this information.
What you expect that MyEclipse can do ?Best regards
What I am expecting is something like a tool that scans the class, finds potential properites that need to be mapped to a database and displays them in a dialog box, suggests a database type for each property (allowing me to change it in the dialog) and suggesting a column name (also allowing me to modify). The tool can also detect relations to other clasees and suggest creating relations between them (one to many, many to one…) and give me options to customize the relation, and when i accept …. the annotations will be written in the right place in the java file, or the xml mapping file for that class (and related classes is generated.
Riyad KallaMemberThis is not currently supported in the tool, but understand what you are asking for. It’s certainly something we could work towards if the majority of users wanted that functionality.
kakbennettMemberThis type of capability is something I’m looking for also. I would like to start with an object model and have a wizard or other tool to help me create the hibernate mapping files needed to forward engineer a database schema using the hibernate schema export library. I am hoping that what’s being referred to as “Visual Hibernate Mapping” in the feature list of the 5.0 release includes this capability. Can someone please explain what Visual Hibernate Mapping feature(s) will be part of the 5.0 release? Specifically, what’s the “Visual” aspect of it?
Riyad KallaMemberThat might be an incorrect reference, I’m looking into it.
kakbennettMember@support-rkalla wrote:
That might be an incorrect reference, I’m looking into it.
Any updates regarding this topic? I would LOVE to see the forward engineering capabilities I referred to in my previous posting show up in MyEclipse. Based on my experience, most object-oriented folks start with an object model, not a database model, when working on new projects. Don’t get me wrong – the reverse engineering capabilities are greate. However, if we could forward engineer a database schema, provide it to our DBAs, and let them make the necessary adjustments as they see fit, this capability in MyEclipse would be extremely valuable and would provide full lifecycle capabilities and give people like me the freedom to choose where to start based upon project needs (i.e., start with an object model for new projects or start with a database model for legacy re-architecture projects). Thanks.
Riyad KallaMemberNo update yet about the visual hibernate reference, but I sent the request for object mapping to the hibernate team to see if it’s easily dooable or if there becomes major problems when trying to make more complex objects to a DB.
AzCoderMemberI would like to see a tool like this as well.
Although, perhaps the best approach is to create the mapping file first and use it to generate both the pojos and the ddl. It does contain enough info for both.
MikeKingMemberI am a beginner with MyEclipse and am trying to persist objects with Hibernate.
I also would like to use MyEclipse Hibernate in the sequence:
1. POJOs
2. Hibernate xDoclet annotations in the POJOs
3. run xDoclet to create the mappings
4. generate the 1st pass tablesI have used the MyEclipse code completion facility to put the xDoclet annotations in a POJO.
I now need to setup an Ant build to execute xDoclet against this POJO.
Is there a wizard or any other MyEclipse assistance to do this?Help will be appreciated.
Riyad KallaMemberMike,
Actually just right click on your project, go to Properties, go to MyEclipse-XDoclet, then add the Hibernate Standard Doclet. Set up the parameters how you see fit, then hit OK. From there you can right click on your project, go to MyEclipse then “Run XDoclet” to generate everything you need.
MikeKingMemberRiyad,
Thanks. You have made my day.Mike
aharveyMemberI am working my through this and am stumbling on the XDoclet settings that I need in order for XDoclet to create my Hibernate .hbm files. Can someone give me a brief rundown of the settings that I need? I believe that I have all of annotations that are required in my POJO.
-
AuthorPosts