Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JPA-RS hooks and/or HATEOAS?(question about integrating JPA-RS )
JPA-RS hooks and/or HATEOAS? [message #904806] Wed, 29 August 2012 07:33 Go to next message
Friso Vrolijken is currently offline Friso VrolijkenFriend
Messages: 1
Registered: August 2012
Junior Member
Hi all,

I saw some content on the JPA-RS work that's being done. It looks very promising to me. But what I can't find is where I can hook in some business logic. Let me clarify: if I've got a resource that's owned by a user, there may be some business logic that dictates:
- which users can read/update/delete that resource
- what values/sub-resources may be updated
- what possible resource states may be
- ....

For that kind of use case I'd expect some kind of hook/plug in both before and after retrieval of the resource, but I can't seem to find it. Does anybody know if it exists?
Or should that be done via ServletFilters?

Another question I've got: is there any support for HATEOAS? I'd expect foreign key relations to be available via hyperlinks, but can't find that either.

Anybody got any information on these subjects? Thanks in advance.

Groeten,

Friso
Re: JPA-RS hooks and/or HATEOAS? [message #905017 is a reply to message #904806] Wed, 29 August 2012 15:03 Go to previous message
Tom Ware is currently offline Tom WareFriend
Messages: 17
Registered: July 2009
Junior Member
Hi Friso,

We have made our initial relase of JPA-RS and the operations that are currently supported are documented here:

(remove spaces to get the full URL)
http://wiki.eclipse.org/EclipseLink/Development/2.4.0/JPA-RS/REST-API

You can find some other information here:

http://wiki.eclipse.org/EclipseLink/Development/2.4.0/JPA-RS

One key thing to understand is that this is our initial release and we are quite interested in feedback about what is good about it and what needs to be improved. We intend to steadily improve the support with each release and are quite interested in building a list of what the community would like. This forum is a great place to provide feedback (along with the users mailing list and bugzilla - for bug reports and feature requests).

As far as your specific comments/questions are concerned:

1. Business Logic

- Right now, the hook w
e have added to allow business logic is the ability to call a SessionBean. That functionality is documented in the API document above.
- Although we have not added any specific support for restricting access at this point, it is possible to use a standard Java EE User/Role based system to restrict based on an authenticated user and a URL pattern.
- Any information you can provide about what functionality you would like to see would be interesting.

2. HATEOAS

- Although they are likely not strictly HATEOAS, we do provide a number of ways to get metadata about your application. Take a look at the Metadata Operations section of the API doc
- Here is an example of a JSON object that could be returned by our current implementation. The foreign references are found in the relationships property:

{
"amount": 120,
"id": 5,
"time": 1346179478765,
"relationships": [(2)
{
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/auction-static/entity/StaticBid/5/auction",
"rel": "auction"
},-
{
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/auction-static/entity/StaticBid/5/user",
"rel": "user"
}-
]-
}


- We are currently working on providing additional options for dealing with foreign references and hope to be able to publish something related to that in the next few weeks.
- Once again, feedback is welcome in that area

[Updated on: Fri, 31 August 2012 14:40] by Moderator

Report message to a moderator

Previous Topic:Converter is not called on load operation
Next Topic:Can not set ManyToOne field to inherited entity
Goto Forum:
  


Current Time: Fri Apr 19 23:07:35 GMT 2024

Powered by FUDForum. Page generated in 0.02655 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top