[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-users] Help with interesting little pointcut: automatically persist @Entity classes
|
- From: Andrew Eisenberg <andrew@xxxxxxxxxxxx>
- Date: Wed, 21 Oct 2009 09:36:28 -0700
- Delivered-to: aspectj-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:reply-to:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; bh=G3OIBPGPvV/FzPBBNC3nQwHynYGWvMMpeubLO8oTD5c=; b=YSXzJK+mMyjMRfkcs+xnXTIfLkEEZIeqjyuxZFTjXYPUgWGHPvucbVB0cnxzM88Kk0 VrXuHaUPuMa6nfwt0ADqKWizb5oAd2epXfxmh45suVTV36o3QZX6GkzKbxjtXxJ8M55o 7OEM8vykbK8BlQg7BV+Aimxu/KDFMjYJSHkfQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=NPUnAqHkzIQzyIryWTjzxoaA4T53gsp+2LI2ZT818ZpMwOD5hkuqQTf6Ze9tuhS6aM o+5EenjIEKoYrg33WkNMiQOvBSmeuQuJHHDR6bKYuVPpNvAQG6fikae9K5zvQ/p+mWIF DVUlJLTmNoE1ybRpXk/TfdAfupeb2B/dZQEik=
Hi Matthew,
Here is where you can use cflow to good measure:
pointcut insidePersistenceProvider() : cflow(within(PersistenceProvider));
And add && !insidePersistenceProvider() to your autopersistentEntity pointcut.
Just a warning though, your autopersistentEntity pointcut is looking a
little complex. I'd try breaking it up or documenting it a bit. 3
months from now, I'm going to guess that you will have no idea what
that pointcut does any more.
--a
> Now this almost does the trick. Problem is, too many constructor
> invocations are advised: not only the ones called by the object model
> client or internally by other object model classes, but also the ones
> called by the persistence provider as well, resulting, not
> surprisingly, in a StackOverflowError.
>
> My question: how can I design a way to only advise constructors
> **not** called by the persistence provider? Alternatively, how can I
> design a way to only advise constructors called from within the object
> model or from object model clients?