You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by nivs <sh...@gmail.com> on 2010/11/30 07:23:12 UTC
Set
Hi
I have a question related to using a collection (Set) within a
PageableListView. At runtime I get an exception
java.lang.ClassCastException: org.hibernate.collection.PersistentSet cannot
be cast to java.util.List
at org.apache.wicket.markup.html.list.ListView.getList(ListView.java:177)
The entity structure is like this
public class Subject{
String firstName;
Set<Phone> phones;
}
I guess it expects only a List type object. I can work around this by
converting the Set into a List and then provide it but felt somehow this is
a limitation. How can I work with generic collections?
Any thoughts much appreciated
thank you
Regards
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Set-Object-with-PageableListView-tp3064906p3064906.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Set<Object> with PageableListView
Posted by jcgarciam <jc...@gmail.com>.
Or you can change your domain from:
Set<Phone> phones;
to:
List<Phone> phones;
On Tue, Nov 30, 2010 at 7:57 AM, Alexander Monakhov-3 [via Apache Wicket] <
ml-node+3065170-145019232-65838@n4.nabble.com<ml...@n4.nabble.com>
> wrote:
> Why are you trying to use component that is intended to work with
> java.util.List when your domain object is Set?
> Try one of AbstractPageableView implementations, f.e. DataView.
>
> Best regards, Alexander.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3065170&i=0>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3065170&i=1>
>
>
>
> ------------------------------
> View message @
> http://apache-wicket.1842946.n4.nabble.com/Set-Object-with-PageableListView-tp3064908p3065170.html
>
> To start a new topic under Apache Wicket, email
> ml-node+1842946-398011874-65838@n4.nabble.com<ml...@n4.nabble.com>
> To unsubscribe from Apache Wicket, click here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=>.
>
>
--
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
--Anyone who has never made a mistake has never tried anything new.--
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Set-Object-with-PageableListView-tp3064908p3065304.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Set
Posted by Alexander Monakhov <do...@gmail.com>.
Why are you trying to use component that is intended to work with
java.util.List when your domain object is Set?
Try one of AbstractPageableView implementations, f.e. DataView.
Best regards, Alexander.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Set
Posted by Pedro Santos <pe...@gmail.com>.
On Tue, Nov 30, 2010 at 4:23 AM, nivs <sh...@gmail.com> wrote:
>
> Hi
>
> I have a question related to using a collection (Set) within a
> PageableListView. At runtime I get an exception
>
Hi, you are trying to make an component that depend on the collection
elements sequence work with a not sequenced collection. For instance, how
the list view will know which is the first component to render and make sure
it is the first one on every render for the
same collection?
> java.lang.ClassCastException: org.hibernate.collection.PersistentSet cannot
> be cast to java.util.List
> at org.apache.wicket.markup.html.list.ListView.getList(ListView.java:177)
>
> The entity structure is like this
>
> public class Subject{
>
> String firstName;
> Set<Phone> phones;
> }
>
> I guess it expects only a List type object. I can work around this by
> converting the Set into a List and then provide it but felt somehow this is
> a limitation.
you can also create and use an adapter model to that
How can I work with generic collections?
>
I didn't understood the question, can you be more specific?
> Any thoughts much appreciated
>
> thank you
> Regards
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Set-Object-with-PageableListView-tp3064906p3064906.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Pedro Henrique Oliveira dos Santos