JPA / Spring / Delete Entity, type Mismatch (int/long for id)
<p>I have an Entity which uses </p>

<pre><code>@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
</code></pre>

<p>and i have a JPA Repository for this Entity. Now i want to delete one of those, but the standard method for that is <code>delete(int i)</code>, which can't work because my ID's are not Integers, but Longs. So apart from using <code>int</code> for my IDs, what to do here? Can i specify a custom delete method which uses long, like it works with <code>findbyXX(XX)</code> ?</p>

<p>EDIT: 
First of all: Yes i am using Data JPA!</p>

<p>I want to do this:</p>

<pre><code>   jparepository.delete(id);
</code></pre>

<p>In case id is an Integer:</p>

<pre><code>org.hibernate.TypeMismatchException: Provided id of the wrong type for class com.Entity. Expected: class java.lang.Long, got class java.lang.Integer
</code></pre>

<p>In case id is a long:</p>

<pre><code>no method found for delete(long)
</code></pre>

<p>So i can either change my ID to int, which i don't want to do, or find a way to get the Repository to work with long. And the question is how </p>