Skip to content

Instantly share code, notes, and snippets.

@gabanox
Created October 16, 2014 15:26
Show Gist options
  • Save gabanox/739ecbd3e74b66c6527f to your computer and use it in GitHub Desktop.
Save gabanox/739ecbd3e74b66c6527f to your computer and use it in GitHub Desktop.
/**
* Created on Oct 17, 2011
*/
package com.company.app.service;
import java.util.List;
import com.company.app.domain.Contact;
public interface ContactService {
// Find all contacts
public List<Contact> findAll();
// Find all contacts with telephone and hobbies
public List<Contact> findAllWithDetail();
// Find a contact with details by id
public Contact findById(Long id);
// Insert or update a contact
public Contact save(Contact contact);
// Delete a contact
public void delete(Contact contact);
// Find all contacts by native query
public List<Contact> findAllByNativeQuery();
// Find contacts by criteria query
public List<Contact> findByCriteriaQuery(String firstName, String lastName);
// Find contacts by first name
public List<Contact> findByFirstName(String firstName);
// Find contacts by first name and last name
public List<Contact> findByFirstNameAndLastName(String firstName, String lastName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment