Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Interceptor
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Fredrik Hultin  
View profile   Translate to Translated (View Original)
 More options May 30 2012, 3:31 am
From: Fredrik Hultin <fredrik.hul...@collabra.se>
Date: Wed, 30 May 2012 00:31:39 -0700 (PDT)
Local: Wed, May 30 2012 3:31 am
Subject: Interceptor
I am using SDN with aspectj. My beans are being backed by the
NodeBacked interface (Neo4jNodeBacking class). This gives me the
possibility to use the object.persist() method that comes with the
interface. I could also use the getTemplate().save(object) method or
simply use the template mapped by spring to save the object (I think
it is all executing the same code in the end).

I would like to execute some code prior to all CRUD`S. In hibernate
you can register an interceptor to do that. Is there anything similar
in Neo4j?

Regards,
Fredrik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc de Verdelhan  
View profile   Translate to Translated (View Original)
 More options May 30 2012, 3:43 am
From: Marc de Verdelhan <marc.deverdel...@yahoo.com>
Date: Wed, 30 May 2012 09:43:40 +0200
Local: Wed, May 30 2012 3:43 am
Subject: Re: [Neo4j] Interceptor

I started a thread a few weeks ago (
https://groups.google.com/d/topic/neo4j/G5IGZybpqWE/discussion) for a
problem of that kind.
Didn't have more time to study the question but I liked the @PrePersist
solution.

Cheers,

Marc

On Wed, May 30, 2012 at 9:31 AM, Fredrik Hultin
<fredrik.hul...@collabra.se>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fredrik Hultin  
View profile   Translate to Translated (View Original)
 More options May 30 2012, 5:53 am
From: Fredrik Hultin <fredrik.hul...@collabra.se>
Date: Wed, 30 May 2012 02:53:27 -0700 (PDT)
Local: Wed, May 30 2012 5:53 am
Subject: Re: Interceptor
I like the whole lifecycle of annotations:

@PrePersist
@PostPersist
@PreRemove
@PostRemove
@PreUpdate
@PostUpdate
@PostLoad

But I think they are complements to Interceptors. Sometimes it easier
to just add an interceptor that gets executed for any CRUD for all
entities.

In your case with the last modified date for example. You could easily
use the reflection api to inspect the bean for any field modifyDate
and set that automatically instead of coding that method on all beans.
So I think there is room for both.

By adding multiple interceptors, like filters in web programming, you
could also move validator executions and other pre executions here.

But as I say, I like them both.

Jira request?

Cheers,
Fredrik

On May 30, 9:43 am, Marc de Verdelhan <marc.deverdel...@yahoo.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »