annotations

using struts2.2.1 annotations with netbeans 6.9 not working

Hello Im doing the convention plugin for struts2.2.1, examples with netbeans6.9 and it seems like something is wrong. I even copy/paste everything and nothing. rightnow I get : "The error message is ${message} " when it should be "The error message is Hello World" i could not post the structure, but I put the jsp under the WEB-...

cannot insert null in one to many relatioship hibernate annotation

I have a class A{Set b .....} which holds references of class B as Set. It is one to many relationship. Both class have sequencer in oracle. I put cascade to all in hibernate annotations. When i save class A, it gives me error that cannot insert null B.a_id . A-id is not nullable in my database. How can i persist this relatioship. ...

reference data is lost when form fails validation in spring3 annotation based controller

I'm doing the spring 3 annotation based controller thing. Problem is, when it fails validation, the reference data is lost, namely the countryDivisions stuff. I didn't put it in the form because its not user editable data, and the orthodoxy here is that only user-editable data goes in the form. Do I have any other choice? @Controller pu...

Generating axis tick annotation that occupies 2 lines

I have a time series I an plotting with jqPlot where I am using a custom tick renderer for the X axis values. However I want to display text shown at each tick position as 2 lines, stacked one above the other. I've tried rendering the string with sprintf and using "\n" but it seems to have no effect - can this be done? I notice i...

Bug with Override annotations in Eclipse

I have a annoying problem with @Override annotations in Eclipse. Often when i import working projects on a new PC, Eclipse marks some of the @Override annotations as wrong. If i remove the annotations everything is fine and Eclipse also indicates that the methods are overriding the parents methods but adding the Override annotation cause...

iPhone MKMapView annotations observers selectable once

Hi, I have different custom map annotations on my MKMapView, and when creating the custom view I add an observer and disable the default popup. At the top of MapViewController.m: static NSString* const ANNOTATION_SELECTED_DESELECTED = @"annotationSelectedOrDeselected"; - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotat...

Understanding client and server side validation using data annotations

Hi, I'm using MVC 2. I have a question regarding client and server side validation. Lets say I have a class, and it has 3 properties as such: [Required(ErrorMessage = "Required")] public object Property1 { get; set; } [Required(ErrorMessage = "Required")] public object Property2 { get; set; } [Required(ErrorMessage = "Required")] p...

Where is the @Autowired annotation supposed to go - on the property or the method?

Which is more correct? This (with the @Autowired annotation on the method)? @Controller public class MyController { private MyDao myDao; @Autowired public MyController(MyDao myDao) { this.myDao = myDao; } This (with the @Autowired annotation on the property)? @Controller public class MyController { @...

Doxygen documentation - how to filter method by annotation (e.g. @api)

We are currently using Doxygen to generate the API. We have put all around the framework annotation as "@api" to tell the developer is allowed to rely on this method since their name won't change. /** * method description * * @api */ function foo() {...} I am looking for a way to only include the methods with these @api annota...

TransientObjectException while saving the details to the database.

"Table 1" can have multiple instances of "Table 2". "Table 2" is one to one mapped with "Table A". But the instance for "Table A" is created by "Table B". "Table 1" need not always have an entry of "Table 2". Table 2 has two columns say tb1 and tbA. tb1 references to primary key of "Table 1" and tbA to that of "Table A". If the data f...

Partition a large Hibernate model to manage schema dependencies

We are considering splitting our hibernate tables into packages or domains (invoicing, sales, ..etc), primarily for dependency management issues. It doesn't break neatly of course, so we aren't sure how to handle relationships that cross domains. It would be nice to have a new entity annotation for this, but meanwhile one idea is to ma...

Spring security ACL, @Secured annotations

Hi guys, I currently running into trouble with spring security, I have been following the two last tutorials referenced on the spring security article page Methods secured with the org.springframework.security.access.annotation.Secured don't seem to trigger any Spring Security logic. This is my test file: public class AclServiceTest...

Is it possible to remove order from Hibernate Criteria?

If I have an @OrderBy("someProperty") annotation on an object and then use a Criteria to add an ORDER BY clause like so: criteria.addOrder(Order.asc("id")); The resulting SQL will do the ordering like this: ORDER BY someProperty, id asc Is it possible to change the order of the two or to remove the someProperty order? I can't r...

How did Java programmers survive before annotations?

Before the introduction of annotations in Java, how was the same functionality achieved? Such a huge portion of what I do every day in Java involves annotations that I can't imagine what it would be like to program without them. What would be an alternative way of achieving the same functionality without annotations? ...

Annotating constructor parameters in Scala

Annotating constructor parameters seems to do nothing when compiled to bytecode. I get no compiler warnings either. The following works. getAnnotations for the name field returns javax.annotation.Nullable. class Person { @Nullable var name: String = _; } The following doesn't, neither with val or var. class Person(@Nullable var ...

Hibernate Annotations and SQL Server

I'm using Hibernate Annotations and trying to save an object. But when saving object I get: Cannot insert the value NULL into column 'status' The thing is that in my SQL Server 2008 configuration that field is defaulted to '0'. Now I dot not want to manually set the default value in my Java code like status='0', because I think this...

Dynamically change RESTEasy service return type.

Am I able to change the value of @Produces annotation parameter in my RESTEasy services?? The task I'm given is to integrate multiple format reporting to an existing reporting system. So changing the @Produces annotation parameter dynamically would help me a lot. Thanks in advance! ...

introspection - table name of an object managed by Hibernate (JavassistLazyInitializer)

I want to get through introspection the table name of an object managed by Hibernate (in lazy). my object contains "org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer" in the property handler. my object is of type "mypackage.myObjectDO_ _javassist_2 $ $" and does not contain the annotations that the class "mypackage.myObjectDO...

Access annotated fields

I made a custom Annotation for my project which will be used only with fields, that is @MyAnnotation int myVariable I have another class which will be in charge of performing some actions according to the variables values.The project has an undetermined number of classes with annotations included. How can I access them using my anno...

iPhone SDK: MapKit multiple custom annotations.

I am able to load a big list of location onto my MapKit and display them all with a custom Pin image and annotation. The issue i'm having is that I currently have all annotations displaying the same Title, Subtitle, and pinImage. How do I make it so that I can set each annotation with its own Title and different Pin image? I'm having a...