Deal of the Day

Home » Main » Manning Forums » 2010 » Spring Roo in Action

Thread: unable to add finder for an entity

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 5 - Pages: 1 - Last Post: Oct 4, 2010 9:15 AM by: mexxik Threads: [ Previous | Next ]
mexxik

Posts: 9
From: kyiv
Registered: 10/3/10
unable to add finder for an entity
Posted: Oct 3, 2010 10:45 AM
  Click to reply to this thread Reply

hello,

from the chapter 3, when trying to
~.model.Task roo> finder add --finderName findTasksByPriorityBetween

it returns:
Managed SRC_MAIN_JAVA/test/model/Task.java
Undo manage SRC_MAIN_JAVA/test/model/Task.java
java.lang.Integer cannot be cast to java.lang.Long


am i doing something wrong again?

mexxik

Posts: 9
From: kyiv
Registered: 10/3/10
Re: unable to add finder for an entity
Posted: Oct 3, 2010 10:59 AM   in response to: mexxik in response to: mexxik
  Click to reply to this thread Reply

i think something wrong with validation annotations
looks like they are blocking adding finders

krimple

Posts: 141
From: Philadelphia, PA USA
Registered: 3/1/09
Re: unable to add finder for an entity
Posted: Oct 3, 2010 11:47 AM   in response to: mexxik in response to: mexxik
  Click to reply to this thread Reply

My apologies, the samples are a bit buggy. I am actually going through Chapter 3 samples this weekend, and if I can get you an update via the forum on what I correct for this error, I will do so.

krimple

Posts: 141
From: Philadelphia, PA USA
Registered: 3/1/09
Re: unable to add finder for an entity
Posted: Oct 3, 2010 11:48 AM   in response to: mexxik in response to: mexxik
  Click to reply to this thread Reply

I think the quick answer (theory) is that Longs aren't necessary for the priority example, and perhaps cause problems when generating the finders. I'll see when I look at that code.

krimple

Posts: 141
From: Philadelphia, PA USA
Registered: 3/1/09
Re: unable to add finder for an entity
Posted: Oct 3, 2010 9:40 PM   in response to: krimple in response to: krimple
  Click to reply to this thread Reply

Ok, one answer so far. The @Min and @Max annotations take a long for each parameter. So, use this:

@Min(1L)
@Max(5L)
private Integer priority;

Ken

mexxik

Posts: 9
From: kyiv
Registered: 10/3/10
Re: unable to add finder for an entity
Posted: Oct 4, 2010 9:15 AM   in response to: krimple in response to: krimple
  Click to reply to this thread Reply

looks like no more errors now

thank you

Legend
Gold: 300 + pts
Silver: 100 - 299 pts
Bronze: 25 - 99 pts
Manning Author
Manning Staff
Manning Developmental Editor