annotations

Annotations complement javadoc tags

Why is it said that Annotations complement javadoc tags? ...

what's the better strategy to store a set of MKAnnotations on file?

Is there a standardized way to persistence for MKAnnotations? ...

How does container injection of annotated private class attributes work in java?

I've started reading the Enterprise Java Beans 3.0 book by Bill Burke and Richard Monson-Haefel and in chapter 4 it has this code @PersistenceContext(unitName="titan") private EntityManager manager; The class then has methods that access this field (which is never set in the constructor and has no setter method). So how does the conta...

Why the RetentionPolicy for @deprecated is RUNTIME?

Why at runtime is anyone interested in knowing that a method is deprecated? Can some provide me with some examples? ...

Why is not possible to extend annotations in Java?

I don't understand why there is no inheritance in Java annotations, just as Java classes. I think it would be very useful. For example: I want to know if a given annotation is a validator. With inheritance, I could reflexively navigate through superclasses to know if this annotation extends a ValidatorAnnotation. Otherwise, how can I ac...

Upgrade hibernate-annotations and hibernate-validator

Hi all. Actually I'm using hibernate-annotations 3.3.1.GA (hibernate 3.2.6.ga) and hibernate-validator 3.0.0.ga but, due to validation problems, I need to upgrade the libraries to hibernate-annotations 3.4.0.GA (hibernate 3.3.2.GA) and hibernate-validator 3.1.0.GA. When I update my pom.xml file I get a lot of compilation errors. I thin...

Hibernate-validator: @NotEmpty does not work for null values

Hi all. I have annotated a String field with @NotEmpty tag. When I try to persist the entity with this filed's value "", it works fine. Mechanism detects the validation error and raises an InvalidStateException exception notifying the issue. But when I try to persist the entity with this field's value null, an UndeclaredThrowableExcep...

Java: How to communicate between an annotation processor and another project?

Hello everyone! I have an own annotation processor (let's call it MyProcessor) and a project (let's call it MyProject) which uses the processor by passing -processor to javac. Now I need MyProcessor to produce some output and make it available for MyProject. I have following options (and problems): Let MyProcessor write a file to th...

How to Configure Hibernate with Eclipse Galileo

Can someone tell me how to configure hibernate (Annotations) with Eclipse? ...

JPA Annotations in Android

Hello, We have a project that uses JPA/Hibernate on the server side, the mapped entity classes are in their own Library-Project and use Annotations to be mapped to the database. I want to use these classes in an Android-Project - is there any way to ignore the annotations within Android, to use these classes as standard POJOs? ...

Is there any way to create form with multiple submit buttons on Spring MVC using annotations?

I'm trying to create simple add/remove form using annotation based Spring MVC. 'Add' functionality comes smoothly, but when I tried to add another button to form i've got stuck. Here is my code: Controller actions: @RequestMapping(value = "/books/documentType.do", method = RequestMethod.GET) public String getDocType( @RequestP...

hibernate - How to annotate a property as enum with a field

How do I map an enum with a field in it? public enum MyEnum{ HIGHSCHOOL ("H"), COLLEGE("C") private int value; public MyEnum getInstance(String value){...} } @Entity public class MyEntity { @Enumerated(...) private MyEnum eduType; } How do I annotate so that values H, C will be persisted in the database? If I keep @Enumerated(EnumTyp...

Adding Java Annotations at Runtime

Is it possible to add an annotation to an object (in my case in particular, a Method) at runtime? For a bit more explanation: I have two modules, moduleA and moduleB. moduleB depends upon moduleA, which doesn't depend upon anything. (modA is my core datatypes and interfaces and such, modB is db/data layer) modB also depends on extern...

Transactional services => BeanNotOfRequiredTypeException, should be Advice, but is TransactionInterceptor

Hi guys, After following the great advice given in a thread about service beans I have made a Service that is listed under. I've tried putting @Transactional at the interface level, interface method level, class level and class method level. However I do it, I get org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean n...

Java: What is the fastest way to inject fields using reflection?

Hello, everyone! Suppose, I have a lot of classes, which are constructed using Java reflection (for some reason). Now I need to post-inject values to fields, which are annotated with @PostInject. public class SomeClass { @PostInject private final String someString = null; public void someMethod() { // here, someString has a...

Eclipse APT slows compiling

I'm currently writing an Eclipse APT plug-in to check if my annotations are correct. But it appears that enabling APT causes my compile process to slow down. Even saving a tiny, unreferenced class takes a few seconds and eats a lot of memory. I think the reason is that the APT framework checks a full tree of objects (large project), ev...

Is it possible to bind a whole class in spring?

Hi,I use spring web flow 2 with hibernate annotations. Is there possible that in my jsp using form tags to bind a whole class? I am asking this, because when I generated my entity classes from SQL Server 2008 using Intellij it autogenerated also my @ManyToOne column (it's about 2 tables: one named Leader-with idLeader,name..and so on and...

iPhone Dev = maps and deselecting annotations

I am successfully drawing annotations on a map using an array of annotations. I can even click on the annotation and change it’s colour or image. My problem arises when the use selects the second annotation and I want to dynamically change the colour or image of the first one back to a non-selected colour/image. I can get the array of al...

mapkit and annotations

Hi I am very new to XCode and iPhone development so please bear with me if this question is too simple. But I have a map and I have successfully added images (not pins) to it for my annotations. And I can change the image when the user selects one of the annotations. I created a class that inherits from MKAnnotationView with the follow...

Using Dependency Injection in POJO's to inject EJB's

Is it possible to inject ejb's into pojo's using the @EJB annotation? If it is, do I have to set up anything special on a JBoss server to make it work? Please let us not discuss the rationale behind doing this - I am just trying to hack some old code to make it work :-) ...