1

At my company, we're currently rebuilding our core application, and we're considering going with Spring Boot as opposed to just Java-Web, JAX-RS, and Weblogic.

We also built a database lib using hibernate which we use on a lot of our services, but we want to rebuild that too using Spring boot.

Now, what I desperately need is some sort of reverse engineering tool to help with this spring boot + hibernate migration. I know a question like this has been asked: questions on spring boot + hibernate and the answer given was, use a generic DAO.

But I'm working with more than a hundred tables!

Perhaps I'm looking at this the wrong way. Maybe I don't need reverse engineering to handle this massive work. In which case, I need some advice.

Thanks guys!

Akin_Glen
  • 697
  • 1
  • 9
  • 31
  • can you paste an example on how your current entities look like? The reason I am asking is because maybe modifying them with regular expressions or some simple program might be easier – Matthias Sep 02 '18 at 07:41
  • You already have the entities why would those need to change? Also why rebuild instead of introducing spring into the applications? – M. Deinum Sep 02 '18 at 07:42
  • @M.Deinum i guess they're not using standard annotations. – Matthias Sep 02 '18 at 07:43
  • They use hibernate and plan on continue to use hibernate, so no problem there. – M. Deinum Sep 02 '18 at 07:44
  • @M.Deinum hi, we're not using the standard annotations. We're using hbm.xml generated files. But if we were able to turn those to annotated entities, are you saying we could reference those entities in spring boot and utitlise the Spring Data Repository? Sorry, if my question sounds odd - we're quite new to Spring. Thanks – Akin_Glen Sep 02 '18 at 08:40
  • What specifically are you wanting to "reverse engineer"? Spring (including Boot) works perfectly well with Hibernate, so you can continue to use your existing entities. If there's some sort of other change to make, describe it in more detail. – chrylis -cautiouslyoptimistic- Sep 02 '18 at 08:50
  • You don't even need annotations. You can just load the those `*.hbm.xml` files. Hibernate needs mapping data which can be annotations or xml (either from JPA or plain Hibernate). So basically HOW that mapping is expressed doesn't really matter. Don't throw those assets away but (re)use them and migrate them eventually to annotated entities. But start with what you have. That applies to the JAX-RS and other stuff as well. Don't throw it away reuse it and introduce Spring Boot. – M. Deinum Sep 03 '18 at 08:13
  • @M.Deinum thanks so much! That makes a lot of sense! Man, I was so confused back there. This makes my work so much easier! – Akin_Glen Sep 04 '18 at 03:57
  • @chrylis you're right. I'm going to do just that. Thanks so much! – Akin_Glen Sep 04 '18 at 03:57

1 Answers1

0

I already had the same experience. you can managed to generated a reverse engineered annotation based version of your database using hibernate-tools.

to use hibernate-tools you need to find the stable version of the hibernate plugin at http://www.jboss.org/tools/download. find more instruction at:

for further information and instruction on how to get to your aim, I propose you to have look at the following links:

Notice that once you manage to do a reverse engineering against your DB, hibernate-tools does not offer a configuration with spring boot and you need to provide it in you project.