Uploaded image for project: 'Spring Data for Apache Cassandra'
  1. Spring Data for Apache Cassandra
  2. DATACASS-521

Enum query arguments not converted

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.10 (Ingalls SR10)
    • Fix Version/s: 1.5.11 (Ingalls SR11)
    • Component/s: None
    • Labels:
      None

      Description

      Passing an enum value to a query method is not converted even if converters are registered:

      	enum Condition {
      
      		Good("+"), NotSoGood("-");
      
      		private final String identifier;
      
      		Condition(String identifier) {
      			this.identifier = identifier;
      		}
      
      		public String getIdentifier() {
      			return identifier;
      		}
      	}
      
      	enum ConditionToStringConverter implements Converter<Condition, String> {
      
      		INSTANCE;
      
      		@Override
      		public String convert(Condition source) {
      			return source.getIdentifier();
      		}
      	}
      
      	interface SampleRepository extends Repository<Person, String> {
      
      		@Query("SELECT * FROM person WHERE condition=?0;")
      		Person findByCondition(Condition condition);
      	}
      

      The resulting statement contains a Condition object instead of converting the enum value to String.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mp911de Mark Paluch
              Reporter:
              mp911de Mark Paluch
              Last updater:
              Spring Issues Spring Issues
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 20 weeks, 3 days ago