I've been using Spring Roo for quite some time now. I really like how it takes the mundane programming away and allows you to really focus on the logic of your app. However I've recently found myself fighting with the runtime because it keeps updating my JPA annotations and removing the attribute names.
I'm calling a stored procedure where I calculate a derived value (the distance to a venue from users current location) and attempt to store it in a JPA record object. I have been able to get the code to work successfully as described in this question SqlResultSetMapping columns as and entities
I managed to do this by disabling the Spring Roo shell and then manually updating the annotation before recompiling my project.
However when I'm writing this logic in the spring source tool suite running a Roo shell, the Roo runtime always updates the annotation from this:
@SqlResultSetMapping(name = "findVenuesByDistanceMapping", entities = { @javax.persistence.EntityResult(entityClass=model.VenueRecord.class) }, columns = { @javax.persistence.ColumnResult(name="distance") })
To this:
@SqlResultSetMapping(name = "findVenuesByDistanceMapping", entities = { @javax.persistence.EntityResult(model.VenueRecord.class) }, columns = { @javax.persistence.ColumnResult("distance")})
You'll notice that it has removed the annotation attribute identifiers. Then when I try to compile the class I get an exception. It seems there is no way to get around this unless I move away from Spring Roo completely. This would be disappointing as I've been using it for months and only recently found an issue I couldn't seem to work around.
Does anyone have any suggestions as to how I can work around this issue? Perhaps even modify the spring roo code to recognise the correct format of annotation?