Skip to content

repository method returning different type of entity than repository entity #1213

@mikereiche

Description

@mikereiche

Edit: The two issues mentioned here will be resolved in #1208.

public UserVO findByName(String name)

I tested this and it is currently possible - with two caveats.
You must define a UserV0Repository, even if you never use it. If you do not, you'll get an exception stating that there is no converter. (I think you've hit this before when you attempted this).
The issue is that the UserV0 type will not be in the mapper's type system, and instead of adding the type, it just gives up.

@Repository
public interface UserV0Repository extends CouchbaseRepository<UserV0, String>
  1. UserV0 must have only fields with names matching the repository entity. Otherwise you'll get a NullPointerException.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions