title: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactUsRepository':
body: <p>I want to create delete row SQL, but when i run my project, i have error,
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactUsRepository': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Not a managed type: class com.oop2.contactus.model.ContactForm</p>
  <p>this my code</p>
  <p>ContactUsList.html</p>
  <pre><code>&lt;a th:href=&quot;@{'/delete-contact-us/'+ ${contactForm.id}}&quot;&gt;Delete&lt;/a&gt;
  </code></pre>
  <p>MainController.java</p>
  <pre><code>@RequestMapping(&quot;/delete-contact-us/{id}&quot;)
      public String deleteContactUs(@PathVariable(name = &quot;id&quot;) int id) {
         contactService.delete(id);
         return &quot;ContactUsList&quot;;
  }
  </code></pre>
  <p>ContactService.java</p>
  <pre><code>public void delete(long id) {
      contactRepository.deleteById(id);
  }
  </code></pre>
  <p>ContactUsRepository.java</p>
  <pre><code>package com.oop2.contactus.repositories;
  import com.oop2.contactus.model.ContactForm;
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.data.repository.CrudRepository;
  import org.springframework.stereotype.Repository;
  
  @Repository
  public interface ContactUsRepository extends CrudRepository&lt;ContactForm, Long&gt; {
  }
  </code></pre>