title: CrudRepository findById returns null mysql
body: <p>I have a Databaseintem, and I have as Id a string. I created an ItemRepository and declared findById, the entry is in the database, but I get null on findById.</p>
  
  <p>import org.springframework.data.repository.CrudRepository;
  import org.springframework.transaction.annotation.Transactional;</p>
  
  <p>Repository:</p>
  
  <pre><code>@Transactional 
  public interface ItemRepository extends CrudRepository&lt;Item, String&gt; {
      public Item findById(String id);
  }
  </code></pre>
  
  <p>Item:</p>
  
  <pre><code>@Entity
  public class Item{
      private String id;
      private String idTrans;
      private String name;
      private Date created;
      private Date modified;
  
  @Id
  public String getId() {
      return id;
  }
  ----
  </code></pre>
  
  <p>I have an ItemService that interacts with the repository and from ItemController I implement a rest api, get.</p>
  
  <p>ItemController:</p>
  
  <pre><code>   @Controller
     @RequestMapping(value = "/item")
     public class ItemController {
  
     @RequestMapping( value = "/{id}", method = RequestMethod.GET )
     @ResponseStatus( HttpStatus.OK )
     @ResponseBody
     public String getItem( @PathVariable( "id" ) String id){
        Preconditions.checkNotNull( id );
        logger.info("1. getAAA " + id); // prints
        Item a = itemService.getItem( id );
        logger.info("2. getAAA " + a);
        return "a : ";// + a.getName();
     }
  </code></pre>
  
  <p>entry in DB"</p>
  
  <pre><code>| token1495528421393 | 2017-05-23 11:33:41 | Itemnull |               0 |        |          0 |          0 | 2017-05-23 11:33:41 |Item1
  </code></pre>
  
  <p>Request GET:</p>
  
  <pre><code>curl -H "Content-Type: application/json" -X GET http://localhost:8090/item/token1495528421393
  </code></pre>
  
  <ul>
  <li>item is null on findById</li>
  </ul>