annotations

How to handle JPA annotations for a pointer to a generic interface

I have a generic class that is also a mapped super class that has a private field that holds a pointer to another object of the same type: @MappedSuperclass public abstract class MyClass<T extends MyIfc<T>> implements MyIfc<T> { @OneToOne() @JoinColumn(name = "previous", nullable = true) private T previo...

What's the best way to annotate this ggplot2 plot? [R]

Here's a plot: library(ggplot2) ggplot(mtcars, aes(x = factor(cyl), y = hp, group = factor(am), color = factor(am))) + stat_smooth(fun.data = "mean_cl_boot", geom = "pointrange") + stat_smooth(fun.data = "mean_cl_boot", geom = "line") + geom_hline(yintercept = 130, color = "red") + annotate("text", label = "130 hp", x = ...

POJOs for Composite Primary Key from Foreign Key

hi, I have table in database that has only two columns and these two colums are FK references. they have made these two colums as composite primarykey. table structure Table A [ A_id PK Description ] Table B [ B_Id PK Description ] Table A_B_Pemissiom [ A_id (FK table A) B_Id (FK table B) Primary...

Using @Secured Annotation causes IS_FULLY_AUTHENTICATED problem in grails

I'm using Acegi/Spring Security in grails and when i use the annotations like @Secured(['ROLE_ADMIN']) it denies my login even though the user is part of ROLE_ADMIN. In looking through the login is it seems that it's getting an IS_AUTHENTICATED_FULLY role also but I have never added that to a page so i'm not sure how to bypass that. I re...

Eclipse Outline View - Visible JavaScript Categories in Eclipse?

I just found an option in the little white down arrow in Eclipse that reads "Visible Categories..." How can I use this? It seems to me that it could be used to only show functions that have an @category in their comments, but I haven't been able to make the "Visible JavaScript Categories" dialog display the categories that work. If ...

How to map Duration type with JPA

I have a property field in a class that is of type javax.xml.datatype.Duration. It basically represents a time span (e.g. 4 hours and 34 minutes). JPA is telling me it is an invalid type, which doesn't shock me. Whats a good solution this? I could implement my own Duration class, but I don't know how to get JPA to "accept" it as a ...

@NamedQuery select parameter meaning

Found some examples of @NamedQuery annotations,e.g.: @NamedQuery(name="employeeBySsn" query="select e from Employee e where e.ssn = :ssn") what does parameter e mean? the second usage of it seems like alias name of table and what does "select e" part mean? ...

Does the DataAnnotations.DisplayAttribute.Order property not work with ASP.NET MVC 2?

I set values for the Order property of the Display attribute in my model metadata. [MetadataType(typeof(OccasionMetadata))] public partial class Occasion { private class OccasionMetadata { [ScaffoldColumn(false)] public object Id { get; set; } [Required] [Display(Name = "Title", Order = 0)] ...

Spring 3 DI using generic DAO interface

I'm trying to use @Autowired annotation with my generic Dao interface like this: public interface DaoContainer<E extends DomainObject> { public int numberOfItems(); // Other methods omitted for brevity } I use this interface in my Controller in following fashion: @Configurable public class HelloWorld { @Autowired pri...

JSF 2 Annotations with Websphere 7 (JEE5, JAVA 1.6)

Hey all, I'm currently writing a simple JSF 2 app for WAS 7. When I define the bean via the faces-config.xml, everything works great <managed-bean> <managed-bean-name>personBean</managed-bean-name> <managed-bean-class>com.prototype.beans.PersonBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </m...

JPA entities -- org.hibernate.TypeMismatchException

Environment: JDK 1.6, JEE5 Hibernate Core 3.3.1.GA, Hibernate Annotations 3.4.0.GA DB:Informix Used reverse engineering to create my persistence entities from db schema [NB:This is a schema in work i cannot change] Getting exception when selecting list of basic_auth_accounts org.hibernate.TypeMismatchException: Provided id of the wrong...

Custom annotation, 'Accessing unknown getter method'

I've made a custom MKAnnotation class, MapLocation. I'm having no trouble setting or getting properties, except in this method to create an MKAnnotationView. I need to do it here, since it's supposed to look up a location type from the annotation's index and select one of a family of custom annotation images for the annotationView. Afte...

Java Annotations in eclipse Tooltip?

Is anyone aware of an eclipse plugin that updates the tooltip on hover over a method/class to include annotation information? There a few libraries we are using that have annotated methods and it would be handy if I could hover over the method and see what has been applied. I realize this would only work with annotations that have been...

How to create a custom Annotation and processing it using APT ?

Hi, I'm new to Java Annotation. I know how to create custom annotation but I don't know how to process that Annotation to generate the dynamic code just like ejb 3.0 and hibernate does. I read some articles based on APT but no one gives the details about how to process the Annotation. Are there any tutorials with sample code for process...

Managing Data Dependecies of Java Classes that Load Data from the Classpath at Runtime

What is the simplest way to manage dependencies of Java classes to data files present in the classpath? More specifically: How should data dependencies be annotated? Perhaps using Java annotations (e.g., @Data)? Or rather some build entries in a build script or a properties file? Is there build tool that integrates and evaluates such in...

Link to audio in XHTML/EPUB

I'm looking into synchronizing an ebook in epub format (so the content is in XHTML) to an audio file. I'm thinking of putting something along the lines of: <a class="audiolink" href="sound.ogg?t=1093"></a> into the body of the document, and then have a custom epub reader that recognizes those tags and synchronizes the audio accordingl...

BindingResult.rejectValue does not find value from ValidationMessages.properties

We're using spring with annotations, and our annotated fields get validated fine and error messages get displayed from ValidationMessages.properties, but for custom validation message from ValidationMessages.properties does not seem to be used. Here's the example: Validatior (also the form): public void validateSpecial(BindingResult...

using the ASP.NET Caching API via method annotations in C#

In C#, is it possible to decorate a method with an annotation to populate the cache object with the return value of the method? Currently I'm using the following class to cache data objects: public class SiteCache { // 7 days + 6 hours (offset to avoid repeats peak time) private const int KeepForHours = 174; public static void...

WebService using annotations in Java

I just went through a few resources on the web to write WebServices using annotations and they claim that the web service is exposed as a servlet. But, it doesn't seem to work for me. It throws a ClassCastException. The code is below: import javax.jws.WebMethod; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import java...

Hibernate many-to-many mapping not saved in pivot table

I having problems saving many to many relationships to a pivot table. The way the pojos are created is unfortunately a pretty long process which spans over a couple of different threads which work on the (to this point un-saved) object until it is finally persisted. I associate the related objects to one another right after they are cre...