Typically, your repository interface will extend
Repository,
CrudRepository or
PagingAndSortingRepository.
Alternatively, if you do not want to extend Spring Data interfaces,
you can also annotate your repository interface with
@RepositoryDefinition
Group items matching
in title, tags, annotations or url
24More
1. Working with Spring Data Repositories - 0 views
-
It allows quick query definition by method names but also custom-tuning of these queries by introducing declared queries as needed.
- ...21 more annotations...
-
The mechanism strips the prefixes find…By, read…By, and get…By from the method and starts parsing the rest of it
-
List<Person> findByEmailAddressAndLastname(EmailAddress emailAddress, String lastname); // Enables the distinct flag for the query List<Person> findDistinctPeopleByLastnameOrFirstname(String lastname, String firstname); List<Person> findPeopleDistinctByLastnameOrFirstname(String lastname, String firstname); // Enabling ignoring case for an individual property List<Person> findByLastnameIgnoreCase(String lastname); // Enabling ignoring case for all suitable properties List<Person> findByLastnameAndFirstnameAllIgnoreCase(String lastname, String firstname); // Enabling static ORDER BY for a query List<Person> findByLastnameOrderByFirstnameAsc(String lastname); List<Person> findByLastnameOrderByFirstnameDesc(String lastname);
-
You can combine property expressions with AND and OR. You also get support for operators such as Between, LessThan, GreaterThan, Like for the property expressions
-
The resolution algorithm starts with interpreting the entire part (AddressZipCode) as the property and checks the domain class for a property with that name (uncapitalized). If the algorithm succeeds it uses that property. If not, the algorithm splits up the source at the camel case parts from the right side into a head and a tail and tries to find the corresponding property, in our example, AddressZip and Code.
-
he infrastructure will recognize certain specific types like Pageable and Sort to apply pagination and sorting to your queries dynamically
-
The first method allows you to pass an org.springframework.data.domain.Pageable instance to the query method to dynamically add paging to your statically defined query. Sorting options are handled through the Pageable instance too
-
Spring is instructed to scan com.acme.repositories and all its subpackages for interfaces extending Repository or one of its subinterfaces. For each interface found, the infrastructure registers the persistence technology-specific FactoryBean to create the appropriate proxies that handle invocations of the query methods. Each bean is registered under a bean name that is derived from the interface name, so an interface of UserRepository would be registered under userRepository
-
This postfix defaults to Impl.Example 1.12. Configuration example<repositories base-package="com.acme.repository" /> <repositories base-package="com.acme.repository" repository-impl-postfix="FooBar" />The first configuration example will try to look up a class com.acme.repository.UserRepositoryImpl to act as custom repository implementation, where the second example will try to lookup com.acme.repository.UserRepositoryFoo
-
To exclude an interface that extends Repository from being instantiated as a repository instance, you can either annotate it with @NoRepositoryBean or move it outside of the configured base-package.
-
]In general, the integration support is enabled by using the @EnableSpringDataWebSupport annotation in your JavaConfig configuration class.
-
In case you need multiple Pageables or Sorts to be resolved from the request (for multiple tables, for example) you can use Spring's @Qualifier annotation to distinguish one from another
-
Spring HATEOAS ships with a representation model class PagedResources that allows enrichting the content of a Page instance with the necessary Page metadata as well as links to let the clients easily navigate the pages.
5More
shared by henry klingberg on 28 Jun 10
- Cached
Redirect After Post - 0 views
www.theserverside.com/...Redirect-After-Post
post redirect after web development get http java programming

-
Instead of returning a result page immediately in response to POST request, server responds with redirect to result page. Browser loads the result page as if it were an separate resource
- ...2 more annotations...
-
When a user tries to refresh the result page, browser resends an "empty" GET request to the server. This request does not contain any input data and does not change server status
96More
Large scale application development and MVP - Part II - Google Web Toolkit - Google Code - 0 views
-
itself
- ...91 more annotations...
-
contactsView.setColumnDefiniions(
-
columnDefinitions = new ArrayList<ColumnDefinition<ContactDetails>>()
-
Inefficiencies related to inserting new elements via DOM manipulation Overhead associated with sinking events per Widget
3More
Lucid Imagination » Don't Use Java 7, For Anything - 1 views
-
In case you upgrade to Java 7, remember that you may have to reindex, as the unicode version shipped with Java 7 changed and tokenization behaves differently (e.g. lowercasing).
-
Unfortunately it contains hotspot compiler optimizations, which miscompile some loops. This can affect code of several Apache projects. Sometimes JVMs only crash, but in several cases, results calculated can be incorrect, leading to bugs in applications
1More
Virgo - Home - 0 views
-
The Virgo Web Server from EclipseRT is a completely module-based Java application server that is designed to run enterprise Java applications and Spring-powered applications with a high degree of flexibility and reliability. It offers a simple yet comprehensive platform to develop, deploy, and service enterprise Java applications. The Virgo kernel supports the core concepts of Virgo and is not biased towards the web server, thus enabling other types of server to be created. The kernel can also be used stand-alone as a rich OSGi application platform. A server runtime can easily be constructed by deploying suitable bundles on top of the kernel.
17More
JavaBlogging » What is serialVersionUID? - 2 views
-
and it is still there even after the program finished. Let’s see if we can read that file once again, this time without creating it first.
-
Now, let’s see what happens, when we change the serialVersionUID value and try to deserialize once again our file. Change the line 2 in the class SerializeMe so that serialVersionUID contains now 2 instead of 1:
- ...13 more annotations...
-
As you can see, this time the deserialization didn’t go well. ObjectInputStream complained about the serialVersionUID being changed.
-
How does he know that it changed? If serialVersinUID is static, then it should not have been serialized in the first place, and there should be no information about the previous value 1 during the deserialization, right? Well, serialVersionUID is an exception to the rule that “static fields don’t get serialized”.
-
Moreover, if there is no serialVersionUID officially declared in the class to be serialized, compiler automatically adds it with a value generated based on the fields declared in the class.
-
The deserialization of that object does not necessarily have to occur exactly after serialization. It can occur after a few months or on a completely different JVM
-
It checks if the data read from the input stream is compatible with the current definition of the class.
-
you might tend to write it once for every serializable class ( or have it generated by the IDE ) and forget about it. WRONG !!!
-
If you write it once and don’t take care to update it when necessary, you loose all the merits of serialVersionUID.
1More
How Offshore Java Development Companies Create 2D Game In Java ME - 0 views
-
With this article, we are going to provide you a quick introduction to Java ME development tools used by offshore Java Development vendors to create MIDlet. Java ME contains small JVM and a set of Java APIs that are used for developing mobile applications. So let's start and create your first mobile app with perfection.
‹ Previous
21 - 29 of 29