How to enable Datanucleus Support in SpringSource tool suite project - jdo

I have a Spring Roo project in which I have to use mongoDB using datanucleus and JDO.Presently when I generated all my classes from the below commands then i Found that all the annotations were taken from JPA.
//create top level package
project --topLevelPackage com.testproject2 --projectName TestProject2
//persistence setup
persistence setup --provider HIBERNATE --database MYSQL --databaseName "users" --hostName "127.0.0.1" --userName "root" --password "password"
//typical security
typicalsecurity setup
How should i use datanucleus support in my project?

Simple search on Spring Roo JIRA gives
https://jira.springsource.org/browse/ROO-2889
so Spring people have still not added support for JDO. Suggest you vote on it. Obviously you could use JPA annotated classes with JDO persistence, but then JPA annotations only express a subset of the things available with JDO

Related

How to implement code first approch without adding any references to web project?

I have added my dbContext in separate class library and added referce of this project to WebAPI project.
Now i want to create a migrations. But to create it i need to add some entity framework references into webapi project too.
this will violate SOP principle of my architechture.
So how can i implement code first approch where my web api is not dependent on DB layer?
It is not necessary for your webapi project to have a direct dependency on EntityFramework.
You can specify your database class library project to be the one which will hold the migrations. E.g:
dotnet ef migrations add MigrationName --project DatabaseClassLibrary --startup-project WebApiProject
The above command will use the WebApiProject as the startup-project as that will most likely (but not always) have the DI setup for creating an instance of your DbContext for your database provider.

Spring Data Rest/HATEOAS without Spring Boot/MVC

Is it possible to use Spring Data Rest/HATEOAS without Spring Boot, Spring MVC on an persistence storage based application. If so how can this be done?
The short answer is Yes. This has been around even before Spring Boot.
The important thing is to ensure the API jars are on your classpath. Get the latest release of Hateoas here and latest release of Spring Data JPA here and add to the classpath. Just pick from the setup you are using (e.g., Maven, Gradle).

hi.i need to create a spring mvc project with Intellij IDEA to do w crud to a MYSQL db

i need to create a spring mvc project with Intellij IDEA to do w crud to a MYSQL db.Can some one help me with z source code running in Intellij IDEA???
Here You have Spring MVC example and PostgreSQL database. Only thing you have to do is to change configuration form PostgresSQL to MySQL:
https://github.com/DanielMichalski/altkom-spring-mvc

Connecting Spring + JPA web application with MySQL

I have been reading how to make web application using spring from the Getting Started Guides, specifically the following guides:
Serving Web Content with Spring MVC
Accessing Data with JPA
But I could not figure how the JPA selected which database driver to store data into.
How can I connect to MySQL database in Spring + JPA.
I learned about Spring + Java Annotations (No XML configurations)
The guides you mention all use Spring Boot.
Spring Boot is a new Spring project that is used for bootstrapping Spring projects. In your case it will auto-configure the datasource for you. Specifically if you have H2 or HSQL on the classpath, Spring will create that in-memory database.
You can easily override the defaults provided by Spring Boot by adding the following properties to application.properties:
spring.datasource.url=jdbc:mysql://whateverhost/whateverdbname
spring.datasource.username=dbuser
spring.datasource.password=dbpass
spring.datasource.driverClassName=com.mysql.jdbc.Driver
For more information check out the relevant documentation.
Or you can check out this tutorial

LDAP CRUD with Spring Roo

Currently making up system with Spring Roo.
Can login with LDAP Server with Spring Security.
But can't understand how to configure LDAP CRUD with Spring Roo.
Roo automatically generates MVC.
From here,
I think have to modify contoller, applicationContext.xml, Entity classes roo automatically generated.
If somebody knows, please tell me kindly.
Thanks,
Spring Roo (from what I know) will not generate domain objects from an LDAP repository. That is you will have to do the "CRUD"ing of your LDAP database yourself.
You can still use Spring to do this with Spring LDAP.
You might want to also look at: https://stackoverflow.com/questions/389746/ldap-java-library
IMHO I find the LDAP Java libraries and LDAP in general to be so overly confusing. So advance sympathy for you pain.

Resources