Skip to main content

Home/ Java Development/ Group items tagged repository

Rss Feed Group items tagged

anonymous

1. Working with Spring Data Repositories - 0 views

  • 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
  • It allows quick query definition by method names but also custom-tuning of these queries by introducing declared queries as needed.
  • CREATE_IF_NOT_FOUND (default)CREATE_IF_NOT_FOUND combines CREATE and USE_DECLARED_QUERY.
  • ...21 more annotations...
  • the first By acts as delimiter to indicate the start of the actual criteria
  • The mechanism strips the prefixes find…By, read…By, and get…By from the method and starts parsing the rest of it
  • you can define conditions on entity properties and concatenate them with And and Or
  • The introducing clause can contain further expressions such as a Distinct to set a distinct flag
  • 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
  • AllIgnoreCase
  • IgnoreCase
  • 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
  • Pageable
  • Sort sort
  • 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
  • <repositories base-package="com.acme.repositories" />
  • 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.
  • @Configuration @EnableWebMvc @EnableSpringDataWebSupport class WebConfiguration { }
  • 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.
Hendy Irawan

Discussion on eclipse-repository packaging type clean-up - Tycho - Confluence - 0 views

  •  
    The packaging type eclipse-repository was originally introduced for building products that can be updated with p2 (cf. TYCHO-188). This requires the following build results: a p2 repository which contains the product IU, and a zip file with the installed product. (Although this is technically no longer needed since the Update Manager was replaced by p2, zip files are still the primary way to distribute Eclipse/RCP installations.) For ease of implementation, this was done in the same packaging type eclipse-repository. In the meantime, eclipse-repository has gained in capabilities (in particular through TYCHO-491), making it difficult for users to choose the right packaging types. This page lays out the mid-term plan of how we want to build products, update site categories, and p2 repositories in Tycho. It also contains a few details how the transition todays (0.11.0) packaging types (eclipse-repository, eclipse-application, eclipse-update-site) to the new types eclipse-repository and eclipse-product.
Hendy Irawan

Playing with AtomPub on CRX « contentGoesHere - 0 views

  •  
    " The primary purpose of the JcrCollectionAdapter class is to equip a stand-alone Atom server with a JCR repository for storage. However, with a bit of tweaking the class can also be used to provide an Atom interface to an existing CRX repository: a simple way to get things running is to leave the existing CRX Quickstart untouched and connect to the repository through RMI. RMI is disabled by default, but on CRX's Knowledge Base is an article how to enable it. "
Hendy Irawan

Sonatype.org: Nexus - 0 views

  •  
    "Sonatype Nexus: Manage Artifacts Sonatype Nexus sets the standard for repository management providing development teams with the ability to proxy remote repositories and share software artifacts. Download Nexus and gain control over open source consumption and internal collaboration."
anonymous

SpringSource Enterprise Bundle Repository - 0 views

  •  
    The SpringSource Bundle Repository provides OSGi-ready versions of hundreds of open source enterprise libraries that are commonly used when developing Spring applications.
Hendy Irawan

AtomPub interface for Guvnor - JBoss Community - 0 views

  •  
    "http://www.atompub.org/ defines a simple interface over HTTP to publish and subscribe to artifacts (files) and collections of artifacts (services/packages). AtomPub interface serves following purposes: 1: provide "feeds" for people/systems to monitor for changes: For example, user subscribes to a feed which lists contents of package or user subscribes to feed which lists changed contents in a package 2. provide the default remote api to push/pull content and meta data from the repository. This allows other applications to integrate with Guvnor by accessing repository content via atom pub programmatically."
Terry Trippany

Artifactory Online :: Welcome - 0 views

  •  
    Spring Online Maven Repository
Hendy Irawan

Shrinkwrap - JBoss Community - 0 views

  • Shrinkwrap provides a simple mechanism to assemble archives like JARs, WARs, and EARs with a friendly, fluent API.
  •  
    Shrinkwrap provides a simple mechanism to assemble archives like JARs, WARs, and EARs with a friendly, fluent API. JavaArchive archive = ShrinkWrap.create(JavaArchive.class,"archive.jar")    .addClasses(MyClass.class,MyOtherClass.class)    .addResource("mystuff.properties"); From there you may deploy directly into any supported integration container like JBoss EmbeddedAS, GlassFish v3 Embedded, Jetty, or OpenEJB.  Or perhaps you'd like to export the archive to a file or exploded directory structure.  Maybe you'd prefer to serialize it over the network to a remote host.  The possibilities are limitless. To boot, ShrinkWrap is the supported deployment mechanism of the Arquillian project, and together we render the testing of true enterprise components amiable as a puppy.  Where Java EE brought a POJO programming model to application development, we've brought it to testing.  You handle your business logic; we'll do the rest. To foster community participation, the majority of documentation and examples are available through our Wiki. Releases are available either via our Downloads section, or through the JBoss Maven Repository, which we recommend is configured in ${userHomeDir}/.m2/settings.xml:
Hendy Irawan

Apache Chemistry - OpenCMIS Overview - 0 views

  •  
    "OpenCMIS is a collection of Java libraries, frameworks and tools around the CMIS (Content Management Interoperability Services) specification. The goal of OpenCMIS is to make CMIS simple for Java client and server developers. It hides the binding details and provides APIs and SPIs on different abstraction levels. It also includes test tools for content repository developers and client application developers."
Hendy Irawan

Building and Running ICEfaces Examples with Maven - ICEfaces - ICEfaces.org Community Wiki - 0 views

  •  
    The maven2 poms and jars for this distribution are located in the following repository location
Hendy Irawan

snakeyaml - YAML parser and emitter for Java - Google Project Hosting - 0 views

  •  
    YAML is a data serialization format designed for human readability and interaction with scripting languages. SnakeYAML is a YAML parser and emitter for the Java programming language. SnakeYAML features a complete YAML 1.1 parser. In particular, SnakeYAML can parse all examples from the specification. Unicode support including UTF-8/UTF-16 input/output. high-level API for serializing and deserializing native Java objects. support for all types from the YAML types repository. relatively sensible error messages.
Hendy Irawan

Querydsl - 0 views

  •  
    Querydsl is a framework which enables the construction of type-safe SQL-like queries for multiple backends including JPA, JDO and SQL in Java. Instead of writing queries as inline strings or externalizing them into XML files they are constructed via a fluent API. Code completion in IDE (all properties, methods and operations can be expanded in your favorite Java IDE) Almost no syntactically invalid queries allowed (type-safe on all levels) Domain types and properties can be referenced safely (no Strings involved!) Adopts better to refactoring changes in domain types Incremental query definition is easier Querydsl is licensed under the LGPL 2.1 license.
Hendy Irawan

Getting started with Spring Data JPA | SpringSource Team Blog - 0 views

  •  
    As we have just released the first milestone of the Spring Data JPA project I'd like to give you a quick introduction into its features. As you probably know, the Spring framework provides support to build a JPA based data access layer. So what does Spring Data JPA add to this base support? To answer that question I'd like to start with the data access components for a sample domain implemented using plain JPA + Spring and point out areas that leave room for improvement. After we've done that I will refactor the implementations to use the Spring Data JPA features to address these problem areas. The sample project as well as a step by step guide of the refactoring steps can be found on Github.
Hendy Irawan

Bndtools - Simple, powerful OSGi tools for Eclipse - 0 views

  •  
    Bndtools is an Eclipse-based development environment for OSGi bundles and applications that focuses on: Ease of use and a rapid development lifecycle; Encouraging OSGi best practices; Producing accurate bundle metadata to maximise re-usability; Integration with offline build tools and users of other IDEs. See Features for a summary of Bndtools features. Bndtools is based on Bnd, the powerful bundle tool created by Peter Kriens. Please read Why Bndtools? to learn why Bndtools has been created and why you should use it for OSGi development in Eclipse.
1 - 14 of 14
Showing 20 items per page