I'm trying to find a way how to implement OneToMany, ManyToOne, ManyToMany relationships in Spring GCP.
According to the reference, there are three ways to represent relationships between entities: embedded, #Descendant and #Reference. And there is no other way to implement the above annotations.
Please, clarify the way about implementation of JPA annotations.
Related
I'd like to bring through entities from another system (e.g. Salesforce) into the Watson chatbot in order to allow the user to interact with them. e.g. Rather than explicitly defining "Customer" and then building a list of customers in Watson I'd like it to integrate and bring through all active Customer records from salesforce, each as their own entity. Is it possible to dynamically update Watson's entity list based on a table in another system?
There is no built-in functionality for that, but it can be done. Watson Assistant / Watson Conversation has an API and SDK support for adding entities. I have used that technique as part of the EgoBot project.
However, I would recommend to integrate Salesforce as a regular backend. Here is a tutorial for how to have a database as backend. Another option, depending on what you want to accomplish, is to look at the Salesforce to Watson integration. There is also a Salesforce / Watson SDK for that.
can Spring framework use NOSQL database?
Is it possible to develop a spring application in which I want to use NoSQL database?
Please provide me with proper proof and example if possible.
Spring Data has multiple projects, quite a number of them are intended to be used with NoSQL databases, you may find a full list here :http://projects.spring.io/spring-data/ (both main and community modules). Some of the notable examples are :
Spring Data Cassandra - http://projects.spring.io/spring-data-cassandra/
Spring Data MongoDB - http://projects.spring.io/spring-data-mongodb/
Spring Data Neo4J (GraphDB) - https://projects.spring.io/spring-data-neo4j/
Spring Data DynamoDB - https://github.com/michaellavelle/spring-data-dynamodb
Spring Data ElasticSearch (search index) - http://projects.spring.io/spring-data-elasticsearch/
...
Have a look at spring data mongodb:
http://projects.spring.io/spring-data-mongodb/
I am trying to choose an auth framework for GAE and would be very interested in other people's experiences on this subject.
I had a look into Shiro and Spring-Security so far. What could you recommend?
Luke Taylor wrote a good blog post explaining how to use Spring Security and GAE together. I believe that both Shiro and Spring Security would be suitable for GAE so it's really a question of what you need. Shiro is simple to implement but limited. In contrast Spring Security is a lot more powerful but this brings some additional complexity. Having said that, recent releases have been much simpler to use (especially since the introduction of namespaces).
Personally I would go for Spring
Personally, I would go with GAE + Guice (ligthweight dependecy injection by Google) + Objectify 5 + JAx-Rs implementation (RestEasy or Jersey) + Shiro.
You can find a good example over here - http://hackersv.blogspot.de/2014/02/shiro-guice-maven-and-google-app-engine.html
Jello-framework is a new Java framework for Google App Engine that includes comprehensive Data Authorization model. One of Jello's key features is its inline Authorization Model. With Jello you can assign different access levels for data elements at any resolution (Namespaces, Entities, Fields, Actions) and specify who is authorized to access the data via the REST API.
I am writting social network.
I have group's blog and user's blog, then I have group's photos and user's photos
How I must design models? all posts(photos) in one db table or in different?
It is preferable to have a single table only for photos, especially if you have multiple photos for each group or user. You could use Single Table Inheritance or Polymorphic Associations to store photos from groups and users in it. I would recommend to read some good books about the topic, Practical Rails Social Networking Sites and RailsSpace: Building a Social Networking Website with Ruby on Rails. Both are recommendable.
I am using subtable inheritance strategy to design my data store using JDO for my application hosted in google app engine. There are three types of users that can logs into my app.
these are the classes that I designed for this purpose 1) User(Abstract)
2)UserType1 extends User 3) UserType2 extends User 4) UserType3 extends User. Now the problem is every time I want to find an user based on the userId I have to check each entity kind separatly. It will become more problem when the user types increases. Please help how to design the model classes in this scenario.
Thanks
you're looking for JDO2's superclass-table inheritance technique. it works similar to the python app engine PolyModel class.
unfortunately, app engine doesn't support superclass-table right now. instead, consider consolidating all of the different class's fields into a single User class with a type enum.