• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Spring 2 + Aspectj, no working when fetching objects from database

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using aspectj to inject my dao into my domain objects, so I can have only a persist method for every domain object and call it from different actions. The thing is that it was working perfectly until I wanted to delete an object.
If I want to create an object I just use:

and in my Car.class I have:

And this works perfecty. The car object attributes are being filled in the form and then I submit to the action. But now I've created my deleteCar method, and it's not working.

and in the Car.class the method is just a cal to dao.delete(). The thing is that the dao is null. So if instead of the car object being created by Struts, I fetch it from the database, the Car object doesn't get a Dao ovject injected. I thought AspectJ injected the dao on every instance being created, but it's not working on this instance that I fetch from the database. Am I doing something wrong? Is this supposed to work?
Thanks!
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic