I'm building a project in JAVA with Dropwizard and are looking to start using Neo4j as database. I have been looking on a lot of different options and think that the spring-data-neo4j lib looks like a good solution.
However, since I haven't been working with Spring earlier, I'm having a hard time figuring out how to setup the configuration classes in order to start building repositoris/DAO's.
I have found a tutorial for integrating springs MySQL-driver, but while reading through the documentation for springs neo4j-driver, I noticed that the neo4j-driver doesn't seem to use the DataSourceFactory establishing a connection.
Anyone have any idea on how to proceed?
Thanks in advance!
Related
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!
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:
How to install Hibernate Tools in Eclipse?
Hibernate Tools in Spring Tool Suite 3.6.1
for further information and instruction on how to get to your aim, I propose you to have look at the following links:
http://www.mkyong.com/hibernate/how-to-generate-code-with-hibernate-tools/
How to generate domain objects with annotations using hibernate tools
https://www.youtube.com/watch?v=IU7cwWMDdjU
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.
I'm faced with a new challenge of supporting multi-tenancy with JPA. I've searched around and it looks like JPA doesn't really offer anything that is usable in the long run. I see a lot of people talking about spring security and picking the tenant datasource from it's context. I don't want to use hibernate or eclipseLink too. Not sure what is the best solution for my problem.
I have an independent service running that needs to kick off queries to various database at random times. I am currently using AWS Redshift as my data store. I will have a connection string available to me as requests come in. I am really un-easy as to what platforms to use to accomplish this? My service is also using spring boot. Anyone have any thoughts? Thank you!!
Problem
I have a relational database schema (in Oracle, but could be in Mysql or Postgres) and I need to expose basic CRUD operations on tables with REST services, all withtout a line of code from a developer.
Constraint of my problems are: java 6/7 only (not scala, groovy, etc..), maven based solution, possibly framework agnostic (could be separated from Spring, for example).
A mandatory requirement is all of this stuff must run on Tomcat (6 or 7).
Bonus: junit of similar automated test on CRUD operation using Mocks and a webpage to test services
Possible solutions
I have already investigated into Spring Roo, not finding a decent configuration or tutorial for my problem.
I have tried to reverse-engineering database using jboss hibernate tools and fits well. Using this tool I can manage to do a maven module (a persistence jar) with all entities mapped.
But I also need a code organization using DAO pattern (to handle entities) and a service layer (to setup REST services).. and this seems to be tricky.
Edit: I've found this solution, using maven hbm2dao, I'm on right path?
Thanks for your time!
p.s: I've found this solution, seems good, but is made with python :(
I have started fooling around with Lift and I wanted to use it on a project that interacts with my legacy database. I have already went through the trouble of getting a Hibernate configuration to work with this database.
So I was wondering if it is possible to build a Lift project that uses the Hibernate code that I have already written. Can anyone show me any good examples or tutorials of that?
You can use any ORM with lift, including Hibernate. There is a full example using JPA and hibernate here
If you have some more questions about that example, you may want to try the Lift mailing list , where the developer who wrote can be reached.
What if you don't want to start a separate project for grails but instead sneak it into an existing webapp?
I have to build an admin interface/crud for some new entities and thought it would be a perfect way to learn grails.
I'm trying to make one application with a Grails app and a Spring app.
I've tried to sneak the Grails App into the Spring one, but this is "impossible". It's easier to sneak the Spring app into the Grails app. Grails knows what Spring is, but Spring has no idea of what Grails is.
In this article you can find useful information about how to use your hibernate mapping files or annotations in Grails, so you don't have to remap everything. Also you can use all your java clases (put them into src/java). You can put the beans defined in the ApplicationContext.xml in conf/spring/resources.xml. You can leave them in ApplicationContext, but I've had some problems.
I don't have ended the job (almost) and it looks good.
It would be hard to "sneak it in" unless the existing app has the correct dir structure that maps exactly to how grails likes it - after all, convention over config is where the power of grails comes from.
You can try doing the admin interface as a "seperate" app to the original/existing spring app, and map the existing database to the grails domain objects. though i m not sure how you would run them side by side easily without more information on the existing app. It is possible definitely though.
I agree that building your admin interface is a good exercise to learn Grails, and also agree with the previous answer that Grails is difficult if not impossible to integrate with an existing Spring application. You could probably get it done, but the headache would not be worth it.
Grails is built on top of Hibernate for its ORM, so if you're already using Hibernate with this Spring app you can work this to your advantage. It's not too difficult to configure a Grails app to use pre-existing Hibernate models, and this is explained well in Grails documentation.
So, I'd recommend building up your admin console as an independent Grails app but make use of the Hibernate models you already have, if in fact you've used Hibernate.