Results 1 to 3 of 3

Thread: @TypeAlias not working (MongoDB)

  1. #1
    Join Date
    Mar 2012
    Posts
    9

    Default @TypeAlias not working (MongoDB)

    My records are getting persisted perfectly except for the _class value, so I wrote the following dummy class to isolate the problem.

    package test;

    import org.springframework.data.annotation.TypeAlias;

    @TypeAlias(value="FOOO")
    public class Data {
    String name;
    }

    The Data records getting persisted still have "_class=test.Data" in them.


    Pretty sure I've done a silly mistake; not sure what.

  2. #2
    Join Date
    Feb 2008
    Location
    Vermont
    Posts
    32

    Default Did you ever figure this out?

    We're having the same problem - did you ever figure this out?

  3. #3
    Join Date
    Mar 2012
    Location
    Burlington, VT
    Posts
    1

    Default Check your xml configuration

    <mongo:mapping-converter id="mappingConverter" base-package="x.y.z">
    ...
    </mongo:mapping-converter>

    That picked up my classes in that package with the @TypeAlias and changed the _class attribute accordingly

Posting Permissions

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