Dmitry Serebrennikov's Library tagged → View Popular
Hibernate Querying 101 : tips and tricks
-
- Use an optimised HQL query to return only the columns you
really need.
Generally, the first option isn't greatly appreciated by the client. So
lets look at the second option. This approach involves determining exactly
which columns you really need, and instanciating data-transfer JavaBean objects
containing exactly those columns.select new CityItem(city.id, city.name, city.electrityCompany.name)
from City city
...
This technique is fast and efficient, and avoids the overheads of handling
associated objects and of loading large numbers of persistent objects
into the Hibernate session cache. The only downside is the need to create
a dedicated data-transfer class for each query. - Use an optimised HQL query to return only the columns you
InfoQ: Structured Event Streaming with Smooks
More on smooks 1.1. Current version is 1.2 - keep in mind.
-
Smooks works by converting a stream of structured/hierarchical data into a stream of "events" that can then be targeted with "Visitor Logic" for analysis, or to produce a result (optional).
-
Create and populate Java Object models/graphs from any of the supported data formats (i.e. not just XML), in a standard way.
- 1 more annotations...
Main Page - Smooks
Interesting - java-to-java transformations, validations simple and business-rule-based, persistence "cartridge" with JPA support.
Chapter 8. Marshalling XML using O/X Mappers
Spring has support for marshaling/unmarshaling. Go figure. "Of course it's in Spring!"
-
Ease of configuration.
Spring's bean factory makes it easy to configure marshallers, without needing to construct JAXB context,
JiBX binding factories, etc. The marshallers can be configured as any other bean in your application
context. Additionally, XML Schema-based configuration is available for a number of marshallers, making
the configuration even simpler.
Consistent Interfaces.
Spring's O/X mapping operates through two global interfaces: the
MarshallerandUnmarshallerinterface.
These abstractions allow you to switch O/X mapping
frameworks with relative ease, with little or no changes required on the classes that do the
marshalling. This approach has the additional benefit of making it possible to do XML marshalling with
a mix-and-match approach (e.g. some marshalling performed using JAXB, other using XMLBeans) in a
non-intrusive fashion, leveraging the strength of each technology.
Consistent Exception Hierarchy.
Spring provides a conversion from exceptions from the underlying O/X mapping tool to its own exception
hierarchy with theXmlMappingExceptionas the root exception. As can be expected,
these runtime exceptions wrap the original exception so no information is lost.
- 5 more annotations...
Make an Installer for your Java Applications | Java By Examp
http://openInstaller.org
Selected Tags
Related Tags
Sponsored Links
Top Contributors
Groups interested in java
-
Java and Java script Programind
Codes and techniques of pro...
Items: 4 | Visits: 113
Created by: stefan stoichev
-
Java
Items: 575 | Visits: 146
Created by: Lubos Pochman
Diigo is about better ways to research, share and collaborate on information. Learn more »
Join Diigo
