Results 1 to 4 of 4

Thread: Problem with Enitity Property/Method Visiblilty

  1. #1

    Default Problem with Enitity Property/Method Visiblilty

    I have created an entity called:

    AuthenticationMaster

    It was reversed from a table in the DB. It created all of the appropriate files:

    AuthenticationMaster.java

    Code:
    @RooJavaBean
    @RooToString
    @RooDbManaged(automaticallyDelete = true)
    @RooEntity(table = "AUTHENTICATION_MASTER", finders = { "findAuthenticationMastersByLogin" })
    public class AuthenticationMaster {
    
    }
    I have the entity AJ class:
    Authentication_Roo_Entity.aj

    Code:
    privileged aspect AuthenticationMaster_Roo_Entity {
        
        declare @type: AuthenticationMaster: @Entity;
        
        declare @type: AuthenticationMaster: @Table(name = "AUTHENTICATION_MASTER");
        
        @PersistenceContext
        transient EntityManager AuthenticationMaster.entityManager;
        
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        @Column(name = "AUTHENTICATIONID")
        private Long AuthenticationMaster.authenticationid;
        
        @Version
        @Column(name = "version")
        private Integer AuthenticationMaster.version;
        
        public Long AuthenticationMaster.getAuthenticationid() {
            return this.authenticationid;
        }
        
        public void AuthenticationMaster.setAuthenticationid(Long id) {
            this.authenticationid = id;
        }
    .....
    I am now creating a spring service.

    UserService.java

    Code:
    @Component("userService")
    public class UserService implements UserDetailsService {
    	@Override
    	public UserDetails loadUserByUsername(String login)
    			throws UsernameNotFoundException, DataAccessException {
    		do {
    			// we need to get the authenticationMaster from the
    			// DB and then create the usermaster object
    			AuthenticationMaster.findAuthenticationMastersByLogin(login);
    		} while (false);
    		return null;
    	}
    }
    In the IDE - the line that uses the finder indicates that the finder is not defined. Also, if I try and create an AuthenticationMaster object, the object does not have any getters or setters. It is just a plain object and doesn't seem to recognize the AspectJ stuff.

    ALSO - I JUST NOTICED THAT WHEN I GENERATE MY ENTITIES, I DON'T GET ANY ASPECTJ MARKERS.

    What could be wrong?

    Thanks,
    Tom
    Last edited by mrbahr2003; Jul 7th, 2011 at 01:11 PM.

  2. #2
    Join Date
    Dec 2005
    Posts
    930

    Default

    Does the project compile OK outside of the IDE, eg with mvn clean package ?
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  3. #3
    Join Date
    May 2006
    Location
    Madrid
    Posts
    382

    Default

    Quote Originally Posted by mrbahr2003 View Post


    ALSO - I JUST NOTICED THAT WHEN I GENERATE MY ENTITIES, I DON'T GET ANY ASPECTJ MARKERS.
    Try Project -> clean... in the STS.

    From time to time the many plugins that we have (maven, aspectj and so on) don't seem to work very well.

    When I have problems like the one you mentioned, rebuild the project in the IDE works for me.

  4. #4

    Default

    yes, sometimes I have to re-clean

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •