Consider this Spring MVC Controller:
@Controller
@RequestMapping("/test*")
public class TestController {
@RequestMapping(method = RequestMethod.GET)
public void doStuff(Model model){
...
}
@RequestMapping(params = "myParam")
public void doStuff(@RequestParam("myParam") int myParam, Model model){
...
}
}
When I p...
I'm trying to integrate Guice into a JSF 1.2 (Sun RI) application, and I want to be able to do the following to my managed-beans:
Inject dependencies using the Guice @Inject annotation, then
Perform initialisation using the @PostConstruct annotation
My problem is that the @PostConstruct method is always invoked before the @Inject ann...
When using aspectj, why use @Component over @Configurable.
I've got spring and aspectj setup for @Transactional support, aspects on self-invocation, and injection into JPA entities. This works great.
I'm using @Component for most classes that need injection, and thus either having them injected into their dependencies. Or, when I can'...
I have a Price object consisting of two MonetaryValues where one MonetaryValue consists of an amount and a currency.
If I configure the OR-mapping the XML-way, I can do this
<component name="baseAmount" lazy="false" class="MonetartyValue">
<property name="amount" column="baseAmount" precision="20" scale="2" not-null="true"...
I want to define injection so that only if the injected interface has EJB it will be injected. This is used as a plug-in to the main EJB. How to do this? Is there some annotation for this?
I can use @PostConstruct to manually "inject" the variable. But then I have to handle the dependencies by myself. How can I handle dependencies knowi...
So, I'm not sure how to ask this question, as it seems like it should be pretty easy to find the answer to this one.
I have 3 tables; ContentHeader, ContentType1 and ContentType2. ContentHeader has a primary, auto-increment key. ContentType1 and ContentType2 both maintain foreign keys to ContentHeader's primary key. These foreign keys ...
I have a Spring 2.5 annotated Controller in which I have a method annotated with @RequestMapping(method=RequestMethod.GET), which performs some logic to fill the model.
I also have a method annotated with @RequestMapping(method=RequestMethod.POST) which performs the request. This method has a @ModelAttribute annotated parameter that con...
I would like to do the following in an ASP.NET page, for both Internet Explorer and Firefox:
Display an uploaded HTML document in a window.
Allow the user to highlight an arbitrary section with the standard text cursor, and press a "leave comment here" button.
Save the exact start and end points of the highlight -- not just the highli...
Hello,
I'm using Hibernate second level cache in my application, for certain business reason I can't change the entity annotation any more.
In my project, apart from changing the Database from Hibernate, there exist also other native SQL that do not go through Hibernate. Therefore, the Hibernate second-level cache data could be stale a...
I'm using a convention of prefixing field names with an underscore. When I generate annotate entity classes with such fields I am stuck to using the underscore-prefixed property names in queries. I want to avoid that, and be able to do:
@Entity
public class Container {
private String _value;
}
// in a lookup method
executeQuery("f...
I have a class I am not sure how to annotate properly.
My goal for Holder::data:
List should maintain order not by comparator but by the natural ordering of the elements in the array. (Which can be an ndx column if that is helpful.)
Holder will have the only reference to data, so Cascade all is probably applicable as well.
I am al...
How is a blob column annotated in Hibernate?
So far I have a class that has:
@Column( name = "FILEIMAGE" )
private byte[ ] fileimage ;
//
public byte[ ] getFileimage ( ) { return this.fileimage ; }
public void setFilename ( String filename ) { this.filename = filename ; }
...
What is the FieldBridge for timestamp in HIbernate Search?
@Field
public java.sql.Timestamp approvedDate;
...
I have two fields of an entity class which I don't want to be unique but to instead be used as composite fields for a key which must itself be unique. For example I have two fields (name and version) which can be the same for other records but together they must be unique. What is the best way to do that using Hibernate (with annotatio...
I'm trying to map an @Embeddable object in a subclass whose parent class already has a field of that @Embeddable type.
The hibernate Embeddable Objects documentation claims I can use the @AttributeOverrides to override the column names of an @Embeddable object:
e.g.
@Entity
public class Person implements Serializable {
// Persist...
I want a simple reusable control that I can use in a form to view and annotate images.
Example usage:
I load an image, or paste from clipboard to the control.
Annotate image, e.g. draw red ring around a feature.
Perhaps add some text.
Save image, or copy to clipboard, in chosen format (i.e. so we can compress).
...
Hi All,
I have tried to find the answer to this question on both the Spring forum and by searching StackOverflow. I have found a lot of pages describing horrible architectures and asking for about the same thing as I do, but my intended usage is different so please bear with me :-)
I have a Spring 2.5 project using annotation based for...
Hi, I have an existing project that uses @Override on methods that override INTERFACE methods, and not superclass methods. I cannot alter this in code, but I would like eclipse to stop complaining about the annotation, as I can still build with maven.
How would I go about disabling this error?
Note: Due to project requirements, I need ...
I'm trying to use an existing database with Grails. My DataSource.groovy starts with this:
import org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration
dataSource {
configClass = GrailsAnnotationConfiguration.class
pooled = true
driverClassName = "com.mysql.jdbc.Driver"
username = "root"
password...
When overriding a virtual method in Java, use of the @Override annotation is recommended, but what if I implement an abstract method? Should I use @Override then as well?
...