You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ken in Nashua <kc...@live.com> on 2013/05/13 09:44:36 UTC
how to use HibernateEntityValueEncoder
Hi Folks,
Finding scant docs on this class usage.
And getting pulled down a rabbit hole.
Are there any example usages of this ?
All i want to do is populate my select component with database entities strings.
thanks
Re: how to use HibernateEntityValueEncoder
Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
In case you exclusively want to get the encoder, you can inject ComponentDefaultProvider and then use
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/ComponentDefaultProvider.html#defaultValueEncoder(java.lang.String, org.apache.tapestry5.ComponentResources)
regards
Taha
On 13-May-2013, at 4:59 PM, "Thiago H de Paula Figueiredo" <th...@gmail.com> wrote:
> On Mon, 13 May 2013 04:44:36 -0300, Ken in Nashua <kc...@live.com> wrote:
>
>> Hi Folks,
>
> Hi!
>
>> Finding scant docs on this class usage.
>>
>> And getting pulled down a rabbit hole.
>>
>> Are there any example usages of this ?
>>
>> All i want to do is populate my select component with database entities strings.
>
> HibernateEntityValueEncoder is used automatically. All you need to do is to have tapestry-hibernate in your classpath. For populating Select's model parameter, you can use the SelectModelFactory service.
>
> --
> Thiago H. de Paula Figueiredo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
Re: how to use HibernateEntityValueEncoder
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 13 May 2013 04:44:36 -0300, Ken in Nashua <kc...@live.com>
wrote:
> Hi Folks,
Hi!
> Finding scant docs on this class usage.
>
> And getting pulled down a rabbit hole.
>
> Are there any example usages of this ?
>
> All i want to do is populate my select component with database entities
> strings.
HibernateEntityValueEncoder is used automatically. All you need to do is
to have tapestry-hibernate in your classpath. For populating Select's
model parameter, you can use the SelectModelFactory service.
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: how to use HibernateEntityValueEncoder
Posted by Jens Breitenstein <ma...@j-b-s.de>.
Hi Ken,
please paste the whole Bean class, too. I got an NPE in the past due to
an leading underscore in my pk member name.
"_pk" --> NPE
"pk" --> works fine. Guess this is a bug, because Tapestry in general
is happy with "_" when accessing properties.
Jens
Am 13.05.13 23:26, schrieb Ken in Nashua:
> its obviously happening on the valueencoder
>
> final PropertyAdapter propertyAdapter = classPropertyAdapter.getPropertyAdapter(labelProperty);5455 final ValueEncoder encoder = this.valueEncoderSource.getValueEncoder(propertyAdapter.getType());56
>
> I changed the property method to toString() and it still fails with NPE
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: How to make login to database virtual mutually exclusive per user
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 23 Oct 2013 18:30:05 -0200, Ken in Nashua <kc...@live.com>
wrote:
> Hi Folks,
Hi!
> I am worried about database collisions amongst the tables since they
> will all need all the tables... or rows for themselves.
As Jens said, this seems to be completely unrelated to Tapestry. I guess
you need to learn more about SQL databases and transaction handling (both
pessimistic and optimistic locking) and probably also how Hibernate and
JPA deals with that.
> I hope this isnt the wrong forum. If it is I could use a friendly push
> to the proper one...
This is the wrong forum. And this isn't even a forum! hehehe
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: How to make login to database virtual mutually exclusive per
user
Posted by Jens Breitenstein <ma...@j-b-s.de>.
Hi Ken,
how is this related to Tapestry?
Am 23.10.13 22:30, schrieb Ken in Nashua:
> Hi Folks,
>
> I have a database.
>
> And I want all users to login...
>
> But I want all my code to cater to each user, regardless of how many are logged in.... SAME CODE BASE... UNLIMITED USERS... CONCURRENCY... CONTENTION...total mayhem
>
> I am worried about database collisions amongst the tables since they will all need all the tables... or rows for themselves.
>
> Can I secure a virtual login by making their USER_ID the primary key to every table in the database ?
>
> Is there a trick I can use with the sessionID?
>
> Just wondering if there is a tech sheet on the dos and donts about this and ramifications of cluster safe too.
>
> Thanks for any tips, best practices or current trends on this topic.
>
> I hope this isnt the wrong forum. If it is I could use a friendly push to the proper one...
>
> - cheers
>
> Ken
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: How to make login to database virtual mutually exclusive per user
Posted by Martin Kersten <ma...@gmail.com>.
Hi,
Check out stackoverflow.com.
Am 23.10.2013 22:30 schrieb "Ken in Nashua" <kc...@live.com>:
> Hi Folks,
>
> I have a database.
>
> And I want all users to login...
>
> But I want all my code to cater to each user, regardless of how many are
> logged in.... SAME CODE BASE... UNLIMITED USERS... CONCURRENCY...
> CONTENTION...total mayhem
>
> I am worried about database collisions amongst the tables since they will
> all need all the tables... or rows for themselves.
>
> Can I secure a virtual login by making their USER_ID the primary key to
> every table in the database ?
>
> Is there a trick I can use with the sessionID?
>
> Just wondering if there is a tech sheet on the dos and donts about this
> and ramifications of cluster safe too.
>
> Thanks for any tips, best practices or current trends on this topic.
>
> I hope this isnt the wrong forum. If it is I could use a friendly push to
> the proper one...
>
> - cheers
>
> Ken
>
How to make login to database virtual mutually exclusive per user
Posted by Ken in Nashua <kc...@live.com>.
Hi Folks,
I have a database.
And I want all users to login...
But I want all my code to cater to each user, regardless of how many are logged in.... SAME CODE BASE... UNLIMITED USERS... CONCURRENCY... CONTENTION...total mayhem
I am worried about database collisions amongst the tables since they will all need all the tables... or rows for themselves.
Can I secure a virtual login by making their USER_ID the primary key to every table in the database ?
Is there a trick I can use with the sessionID?
Just wondering if there is a tech sheet on the dos and donts about this and ramifications of cluster safe too.
Thanks for any tips, best practices or current trends on this topic.
I hope this isnt the wrong forum. If it is I could use a friendly push to the proper one...
- cheers
Ken
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
Hey Joakim...
I tried your suggestion... and it worked.
I actually created an interface with a host of default methods that I am forcing down the hierarchy... one of which is displayableName.
And I made it past the tapestry code...
final PropertyAdapter propertyAdapter = classPropertyAdapter.getPropertyAdapter(labelProperty);
final ValueEncoder encoder = this.valueEncoderSource.getValueEncoder(propertyAdapter.getType());
propertyAdapter is not null anymore... and so I am able to get my encoder successfully now.
Thanks a bunch...
- ciao
KEN
public interface IAbstractEntity {
@NonVisual
@PropertyDescriptor(nonVisual = true, searchable = false)
public Long getCreated();
@NonVisual
@PropertyDescriptor(nonVisual = true, searchable = false)
public Long getAccessed();
@NonVisual
@PropertyDescriptor(nonVisual = true, searchable = false)
public void setCreated(Long created);
@NonVisual
@PropertyDescriptor(nonVisual = true, searchable = false)
public void setAccessed(Long accessed);
@Transient
@PropertyDescriptor(nonVisual = true, searchable = false)
public String getCreatedAsString();
@Transient
@PropertyDescriptor(nonVisual = true, searchable = false)
public String getAccessedAsString();
@Transient
@PropertyDescriptor(nonVisual = true, searchable = false)
public void setCreatedAsString(String value) throws Exception;
@Transient
@PropertyDescriptor(nonVisual = true, searchable = false)
public void setAccessedAsString(String value) throws Exception;
public String getDisplayableName();
public void setDisplayableName(String displayableName);
public int hashCode();
public boolean equals(Object obj);
public String toString();
}
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
Joakim,
Thank you for the suggestion.
I was hoping for checkins on the framework I use but non yet. I am stuck until that happens.
But I can unit test while stuck.
I will try your suggestion... making a get/set displayableString() and just put toString() inside of it.
The tapestry framework should consider using toString as the default for objects populating <select> and contained options by default.
I will let you know the result.
Have a good day friend
Ken
Re: how to use HibernateEntityValueEncoder
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 16 May 2013 15:55:39 -0300, Ken in Nashua <kc...@live.com>
wrote:
> So it sounds like...
>
> I need to implement an auxillary property called
> getDisplayableName/setDisplayableName in order for this to make it into
> the options construct's.
> for EVERY class I intend to populate into any select.
Just if you don't have a property which already provides what you want.
Most of my entity classes have a "name" field and property that could be
used already. Of course, whether this is sufficient of enough is very
dependent on the specific scenario. And you actually need just the getter.
And this is actually pretty standard Java stuff.
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
So it sounds like...
I need to implement an auxillary property called getDisplayableName/setDisplayableName in order for this to make it into the options construct's.
for EVERY class I intend to populate into any select.
toString is the default displayable for any object
i vote for that to be the default instead
Thanks for pointing that out for me Thiago.
If I can get my webapp to run then i will test it out and maybe implement my own SelectModelFactoryImpl
- cheers
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
Thanks Joakim... for trying
I tried to get a clean head rev build off my framework providers but its never had a clean head rev build ever (months and years) and I have been very quiet about it limping along waiting for pristine code. They seem to be under the impression that everything just works and tooting their horns on the framework site... when it dont... otherwise I would have been long gone spent busying myself focusing on business logic instead of build problems, codebase corruption code base instrumentation to overcome issues.
So I am going to SHcan my attempt at getting a clean fresh build to eliminate these problems and revert back to the buggy code base I have been wrestling with. But if that worked I would have been focusing on business logic still.
I will give your suggestion a try.
I have been known to be a big mouth or sometimes a bad mouth about open source. At least when I was a committer I maintained a clean and tight head rev build and was always QA'ing the base line functionality to avoid any road blocks or show stoppers for users potentially waiting to go live.
Thanks friend
- cheers
Re: how to use HibernateEntityValueEncoder
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 14 May 2013 23:39:46 -0300, Ken in Nashua <kc...@live.com>
wrote:
> tapestry cannot articulate the labelProperty
> I specified "toString"
Of course Tapestry cannot find the toString property. As Joakim said,
toString() is not a property. It's a method, but not a property.
Properties are defined by get and set methods. That's basic Java knowledge.
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: how to use HibernateEntityValueEncoder
Posted by Joakim Olsson <jo...@unbound.se>.
What if you add a getDisplayString-method that just do return toString()
and change to displayString as property instead. toString does not follow
the bean property naming standard get/set/is.
/Joakim
On Wed, May 15, 2013 at 4:39 AM, Ken in Nashua <kc...@live.com> wrote:
> Thanks Thiago... trust me I would send a console trace if I got one. Maybe
> my logger isnt tracing those packages in tapestry ?
>
> The NPE occurs inside (well i sent the browser trace)...
>
>
> org.tynamo.examples.pphl.pages.Query)org.apache.tapestry5.ioc.internal.util.TapestryExceptionjava.lang.NullPointerExceptionFilter
> stack frames
> Stack trace
>
>
> org.apache.tapestry5.internal.services.SelectModelFactoryImpl.create(SelectModelFactoryImpl.java:55)
>
> Its happening inside the create call
>
> tapestry cannot articulate the labelProperty
>
> I specified "toString"
>
> I put this in the threads few threads back.
>
> I appreciate your help
>
> And no I am not using any dashes or underscores in the primary keye
> method...
>
> Still hoping for a workaround
>
>
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
Thanks Thiago... trust me I would send a console trace if I got one. Maybe my logger isnt tracing those packages in tapestry ?
The NPE occurs inside (well i sent the browser trace)...
org.tynamo.examples.pphl.pages.Query)org.apache.tapestry5.ioc.internal.util.TapestryExceptionjava.lang.NullPointerExceptionFilter
stack frames
Stack trace
org.apache.tapestry5.internal.services.SelectModelFactoryImpl.create(SelectModelFactoryImpl.java:55)
Its happening inside the create call
tapestry cannot articulate the labelProperty
I specified "toString"
I put this in the threads few threads back.
I appreciate your help
And no I am not using any dashes or underscores in the primary keye method...
Still hoping for a workaround
Re: how to use HibernateEntityValueEncoder
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
What could really help us in helping you was if you told us in which line
the NPE happens. It's really quite hard to help you sometimes. You post a
lot of messages and still doesn't provide us the information needed to
help you. :(
On Tue, 14 May 2013 09:15:16 -0300, Ken in Nashua <kc...@live.com>
wrote:
> Hi Jens,
>
> I posted the pojo bean Year.java
>
> I really rely on the toString() for most of my entities.
>
> I wouldnt think of complicating any of my getters with dashes or
> underscores let alone complicate a primary keye method.
Nobody ever suggested you did that. Someone just mentioned that leading
underscores are not handled well by PropertyAdapter so you could check if
that was the case.
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
Hi Jens,
I posted the pojo bean Year.java
I really rely on the toString() for most of my entities.
I wouldnt think of complicating any of my getters with dashes or underscores let alone complicate a primary keye method.
This one is fairly obvious.
I know I have some environment concerns and need o sync up with greatest/latest tynamo but for the most part my webapp is running.
Hoping for a way out of this one today.
What if I had a dozen select criteria components on my page ?
Well i do...
: (
I am trying to model stats just like NHL.com
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
This guy is the culprit... tap-5.3.6
I believe it needs to depend on a default toString() is it fails to find a labelProperty.
I need a workaround folks... so waiting on your best.
thanks
KEN
@SuppressWarnings("unchecked")
public SelectModel create(final List<?> objects, final String labelProperty)
{
final List<OptionModel> options = CollectionFactory.newList();
for (final Object object : objects)
{
final ClassPropertyAdapter classPropertyAdapter = this.propertyAccess
.getAdapter(object);
final PropertyAdapter propertyAdapter = classPropertyAdapter.getPropertyAdapter(labelProperty);
final ValueEncoder encoder = this.valueEncoderSource.getValueEncoder(propertyAdapter.getType());
final Object label = propertyAdapter.get(object);
options.add(new OptionModelImpl(encoder.toClient(label), object));
}
return new SelectModelImpl(null, options);
}
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
Ok I am stepping thru the tapestry code during the create call...
This is interesting...
UnClaimedFieldWorker.JAVA
public Object get(Object instance, InstanceContext context)
{
return fieldValue.get(fieldDefaultValue);
}
fieldDefaultvalue == null
no npe as of yet
its starts iterating thru my obejct list looks good so far
I am at this line in SelectModelFactoryImpl.JAVA
final PropertyAdapter propertyAdapter = classPropertyAdapter.getPropertyAdapter(labelProperty);
this is what I see for classPropertyAdapter
<ClassPropertyAdaptor org.tynamo.examples.pphl.model.Year : accessed, accessedAsString, class, created, createdAsString, id, league, yearEnd, yearStart>
WHY ISNT THE toString method in this ? it is a legitimate property... yes ?
Anyway I specified my labelProperty to be "toString" which should be the default by common sense?
propertyAdapter keeps coming back with NULL.
What can I do to my Year.JAVA to make this work ?
Thanks for your help guys
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
Hi Guys,
really sorry about my lapse here in providing the right info and I kow it must be frustrating.
I played hockey last night. So i got pre-empted.
Ok I am back on the tarp.
I will try to get the stack trace for you... but none is being produced in the console... and its an NPE ? I am wondering about that.
My Year.Java class... yes its a pojo... I dont understand why that might be a crime... maybe for Date stuff... but its fairly remote and implemented independent.
Ok back to he real stuff...
Ok I am seeinfg the source code for this has tajken on some changes,,,
Here is my blip
@Inject
@Property
private TypeCoercer typeCoercer;
@Property
private SelectModel yearSelectModel;
@Property
@Persist(PersistenceConstants.FLASH)
private Year year;
@Inject
private PropertyAccess adapter;
@Inject
private ValueEncoderSource valueEncoderSource;
@SetupRender
void setupRender() {
SelectModelFactory selectModelFactory = new SelectModelFactoryImpl(adapter, valueEncoderSource);
grid.reset();
years = new ArrayList(TynamoUTIL.loadCollection(hibernatePersistenceService, Year.class));
yearSelectModel = selectModelFactory.create(years, "toString");
selectModelFactory is failing because my usage of SelectModelFactoryImpl fails to operate. So I told eclipse to connect to the source code downloaded to my local repo... and sure enough.. in the debugger I see this...
final PropertyAdapter propertyAdapter = classPropertyAdapter.getPropertyAdapter(labelProperty);
final ValueEncoder encoder = this.valueEncoderSource.getValueEncoder(propertyAdapter.getType());
my propertyAdapter is null and any subsequent attempts to use it fail with NPE
But I need to distinguish some kind of label property ? in my year class to this thing ? So it can create the proper OPTIONS eFrastructure ?
I figured the Year.toString() method would suffice for this.
Here is my Year.JAVA again
Not sure what to think... tapestry is failing when I tell it to use Year.toString()
What should I do ?
@Entity
@ClassDescriptor(hasCyclicRelationships = true, nonVisual = false)
public class Year implements Cloneable, Serializable {
private static final Log log = LogFactory.getLog(Year.class);
private Integer id = null;
private Integer yearStart = new Integer("0");
private Integer yearEnd = new Integer("0");
private League league = null;
private Long created = new Long(GregorianCalendar.getInstance()
.getTimeInMillis());
private Long accessed = new Long(GregorianCalendar.getInstance()
.getTimeInMillis());
/**
* CTOR
*/
public Year() {
}
public Year(Year dto) {
try {
BeanUtils.copyProperties(this, dto);
} catch (Exception e) {
log.error(e.toString());
e.printStackTrace();
}
}
/**
* Accessor for id
*
* @return Integer
* @hibernate.id generator-class="increment" unsaved-value="-1"
* type="java.lang.Integer" unique="true" insert="true"
*/
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@PropertyDescriptor(readOnly = true)
public Integer getId() {
return id;
}
@PropertyDescriptor
public Integer getYearStart() {
return yearStart;
}
@PropertyDescriptor
public Integer getYearEnd() {
return yearEnd;
}
@ManyToOne
public League getLeague() {
return league;
}
@PropertyDescriptor(nonVisual = true, searchable = false)
public Long getCreated() {
return created;
}
@PropertyDescriptor(nonVisual = true, searchable = false)
public Long getAccessed() {
return accessed;
}
@Transient
@PropertyDescriptor(nonVisual = true, searchable = false)
public String getCreatedAsString() {
Calendar cal = new GregorianCalendar();
cal.setTimeInMillis(created.longValue());
return DatePattern.sdf.format(cal.getTime());
}
@Transient
@PropertyDescriptor(nonVisual = true, searchable = false)
public String getAccessedAsString() {
Calendar cal = new GregorianCalendar();
cal.setTimeInMillis(accessed.longValue());
return DatePattern.sdf.format(cal.getTime());
}
public void setId(Integer id) {
this.id = id;
}
public void setYearStart(Integer yearStart) {
this.yearStart = yearStart;
}
public void setYearEnd(Integer yearEnd) {
this.yearEnd = yearEnd;
}
public void setLeague(League league) {
this.league = league;
}
@Transient
@PropertyDescriptor(nonVisual = true, searchable = false)
public void setCreatedAsString(String value) throws Exception {
Calendar cal = new GregorianCalendar();
cal.setTimeInMillis(DatePattern.sdf.parse(value).getTime());
this.created = new Long(cal.getTimeInMillis());
}
@Transient
@PropertyDescriptor(nonVisual = true, searchable = false)
public void setAccessedAsString(String value) throws Exception {
Calendar cal = new GregorianCalendar();
cal.setTimeInMillis(DatePattern.sdf.parse(value).getTime());
this.accessed = new Long(cal.getTimeInMillis());
}
public void setAccessed(Long accessed) {
this.accessed = accessed;
}
public void setCreated(Long created) {
this.created = created;
}
@Override
public int hashCode() {
return (getId() != null ? getId().hashCode() : 0);
}
@Override
public Year clone() {
return new Year(this);
}
/**
* equals and hashCode need to be hammered out for hibernate to work
* properly
*
* Check the matrix summary for best practices at
* http://www.hibernate.org/109.html
*/
@Override
public boolean equals(Object rhs) {
if (this == rhs)
return true; // instance equality
if (rhs == null || getClass() != rhs.getClass())
return false; // null/class equality
final Year castedObject = (Year) rhs;
return !(getId() != null ? !getId().equals(castedObject.getId())
: castedObject.getId() != null);
}
public String toString() {
return getYearStart().toString() + "/" + getYearEnd().toString();
}
}
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
its obviously happening on the valueencoder
final PropertyAdapter propertyAdapter = classPropertyAdapter.getPropertyAdapter(labelProperty);5455 final ValueEncoder encoder = this.valueEncoderSource.getValueEncoder(propertyAdapter.getType());56
I changed the property method to toString() and it still fails with NPE
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
Thanks Jens...
I believe I posted the Year.class for Thiago
the primary keye is just ID
Is this a bug ?
I would like to get into the create routine for the factory but dont know how
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
Ooops... this is the code I am exercising...
@Persist
@Property
private EnumValueEncoder yearValueEncoder;
@Inject
@Property
private TypeCoercer typeCoercer;
@Inject
private SelectModelFactory selectModelFactory;
@Property
private SelectModel yearSelectModel;
@Property
@Persist(PersistenceConstants.FLASH)
private Year year;
@SetupRender
void setupRender() {
grid.reset();
years = new ArrayList(TynamoUTIL.loadCollection(hibernatePersistenceService, Year.class));
yearValueEncoder = new EnumValueEncoder(typeCoercer, Year.class);
yearSelectModel = selectModelFactory.create(years, "year");
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
Thanks Jens...
I just stepped thru debugger...
@SetupRender
void setupRender() {
grid.reset();
years = new ArrayList(TynamoUTIL.loadCollection(hibernatePersistenceService, Year.class));
yearValueEncoder = new EnumValueEncoder(typeCoercer, Year.class);
this is what the debugger shows for my years collection after loadCollection gets called.
[2012/2013]
Thats an entity... Year.class... the toString method
So the collection is populating properly. Its stored with standard hibernate Integer id.
Kinda blue in the face... kinda
Re: how to use HibernateEntityValueEncoder
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 13 May 2013 17:15:05 -0300, Ken in Nashua <kc...@live.com>
wrote:
> Hi Thiago,
>
> Here is the console... after I induce the NPE.
It doesn't contain the stack trace, so it's completely useless.
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
Hi Thiago,
Here is the console... after I induce the NPE.
2013-05-13 16:11:14.622:INFO:oejs.Server:jetty-7.6.0.v20120127
2013-05-13 16:11:22.970:INFO:oejpw.PlusConfiguration:No Transaction manager found - if your webapp requires one, please configure one.
2013-05-13 16:11:23.424:INFO:oejsh.ContextHandler:started o.m.j.p.JettyWebAppContext{/,file:/C:/Prototype/Mavenized/Product/tynamo/trunk/tynamo-examples/pphl/src/main/webapp/},file:/C:/Prototype/Mavenized/Product/tynamo/trunk/tynamo-examples/pphl/src/main/webapp/
2013-05-13 16:11:29.726:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server
127.0.0.1 - - [13/May/2013:20:11:34 +0000] "GET /pphl/login HTTP/1.1" 200 3301 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/core/default.css HTTP/1.1" 200 2089 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/kawwa2_asset/css/k-structure.css HTTP/1.1" 200 990 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/core/tree.css HTTP/1.1" 200 570 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/core/t5-alerts.css HTTP/1.1" 200 386 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/core/tapestry-console.css HTTP/1.1" 200 322 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/form.css HTTP/1.1" 200 77 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/kawwa2_asset/css/library.css HTTP/1.1" 200 137 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/facebook/components/fb-button.css HTTP/1.1" 200 1395 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/tap-jquery/tapestry.js HTTP/1.1" 200 1739 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/openid-0.2.1-SNAPSHOT-1367865189000/components/button.css HTTP/1.1" 200 1429 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/ui_1_8_24/jquery.ui.widget.js HTTP/1.1" 200 2344 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/ui_1_8_24/jquery.ui.core.js HTTP/1.1" 200 3439 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/ui_1_8_24/jquery.ui.position.js HTTP/1.1" 200 2772 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/jquery.effects.show.js HTTP/1.1" 200 105 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/ui_1_8_24/jquery.effects.highlight.js HTTP/1.1" 200 608 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/jquery.json-2.2.js HTTP/1.1" 200 1930 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/ui_1_8_24/jquery.effects.core.js HTTP/1.1" 200 5436 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/core/t5-spi.js HTTP/1.1" 200 1113 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/t5-jquery.js HTTP/1.1" 200 771 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/core/underscore_1_3_3.js HTTP/1.1" 200 10511 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/core/t5-init.js HTTP/1.1" 200 609 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/core/t5-pubsub.js HTTP/1.1" 200 2362 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/core/t5-events.js HTTP/1.1" 200 892 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/core/t5-core.js HTTP/1.1" 200 925 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/t5-dom-jquery.js HTTP/1.1" 200 1805 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/t5-console-jquery.js HTTP/1.1" 200 1108 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/t5-ajax-jquery.js HTTP/1.1" 200 2285 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/kawwa2_asset/theme/css/k-theme0.css HTTP/1.1" 200 17510 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/t5-alerts-jquery.js HTTP/1.1" 200 1265 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/jquery_core/jquery-1.7.2.js HTTP/1.1" 200 73890 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/core/t5-formfragment.js HTTP/1.1" 200 915 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/t5-tree-jquery.js HTTP/1.1" 200 1458 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/core/tapestry-messages.js HTTP/1.1" 200 846 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/core/tapestry-console.js HTTP/1.1" 200 500 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/validation.js HTTP/1.1" 200 2477 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/twitter/components/sign-in-with-twitter-d.png HTTP/1.1" 200 3306 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/federated/base/OauthSignIn.js HTTP/1.1" 200 317 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/openid-0.2.1-SNAPSHOT-1367865189000/components/google-icon.png HTTP/1.1" 200 1996 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/kawwa2_asset/theme/img/k-theme0/bg_required.png HTTP/1.1" 200 1111 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/tapestry-jquery.js HTTP/1.1" 200 9396 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/tapestry-beanvalidator-jquery.js HTTP/1.1" 200 429 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/kawwa2_asset/theme/css/PTS55F-webfont.woff HTTP/1.1" 200 25531 "http://localhost:8080/assets/1.0-SNAPSHOT-1368475842243/kawwa2_asset/theme/css/k-theme0.css" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/ctx/images/secure1.jpg HTTP/1.1" 200 5121 "http://localhost:8080/pphl/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/kawwa2_asset/theme/css/PTS75F-webfont.woff HTTP/1.1" 200 24423 "http://localhost:8080/assets/1.0-SNAPSHOT-1368475842243/kawwa2_asset/theme/css/k-theme0.css" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/kawwa2_asset/theme/css/Novecentowide-Medium-webfont.woff HTTP/1.1" 200 22019 "http://localhost:8080/assets/1.0-SNAPSHOT-1368475842243/kawwa2_asset/theme/css/k-theme0.css" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:38 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/kawwa2_asset/theme/css/Novecentowide-Book-webfont.woff HTTP/1.1" 200 19396 "http://localhost:8080/assets/1.0-SNAPSHOT-1368475842243/kawwa2_asset/theme/css/k-theme0.css" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:39 +0000] "GET /pphl/query HTTP/1.1" 500 8341 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
127.0.0.1 - - [13/May/2013:20:11:42 +0000] "GET /assets/1.0-SNAPSHOT-1368475842243/jquery/exceptiondisplay-jquery.js HTTP/1.1" 200 588 "http://localhost:8080/pphl/query" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
whats so bad about a year class ?
@Entity
@ClassDescriptor(hasCyclicRelationships = true, nonVisual = false)
public class Year implements Cloneable, Serializable {
private static final Log log = LogFactory.getLog(Year.class);
private Integer id = null;
private Integer yearStart = new Integer("0");
private Integer yearEnd = new Integer("0");
private League league = null;
private Long created = new Long(GregorianCalendar.getInstance()
.getTimeInMillis());
private Long accessed = new Long(GregorianCalendar.getInstance()
.getTimeInMillis());
/**
* CTOR
*/
public Year() {
}
public Year(Year dto) {
try {
BeanUtils.copyProperties(this, dto);
} catch (Exception e) {
log.error(e.toString());
e.printStackTrace();
}
}
/**
* Accessor for id
*
* @return Integer
* @hibernate.id generator-class="increment" unsaved-value="-1"
* type="java.lang.Integer" unique="true" insert="true"
*/
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@PropertyDescriptor(readOnly = true)
public Integer getId() {
return id;
}
@PropertyDescriptor
public Integer getYearStart() {
return yearStart;
}
@PropertyDescriptor
public Integer getYearEnd() {
return yearEnd;
}
@ManyToOne
public League getLeague() {
return league;
}
@PropertyDescriptor(nonVisual = true, searchable = false)
public Long getCreated() {
return created;
}
@PropertyDescriptor(nonVisual = true, searchable = false)
public Long getAccessed() {
return accessed;
}
@Transient
@PropertyDescriptor(nonVisual = true, searchable = false)
public String getCreatedAsString() {
Calendar cal = new GregorianCalendar();
cal.setTimeInMillis(created.longValue());
return DatePattern.sdf.format(cal.getTime());
}
@Transient
@PropertyDescriptor(nonVisual = true, searchable = false)
public String getAccessedAsString() {
Calendar cal = new GregorianCalendar();
cal.setTimeInMillis(accessed.longValue());
return DatePattern.sdf.format(cal.getTime());
}
public void setId(Integer id) {
this.id = id;
}
public void setYearStart(Integer yearStart) {
this.yearStart = yearStart;
}
public void setYearEnd(Integer yearEnd) {
this.yearEnd = yearEnd;
}
public void setLeague(League league) {
this.league = league;
}
@Transient
@PropertyDescriptor(nonVisual = true, searchable = false)
public void setCreatedAsString(String value) throws Exception {
Calendar cal = new GregorianCalendar();
cal.setTimeInMillis(DatePattern.sdf.parse(value).getTime());
this.created = new Long(cal.getTimeInMillis());
}
@Transient
@PropertyDescriptor(nonVisual = true, searchable = false)
public void setAccessedAsString(String value) throws Exception {
Calendar cal = new GregorianCalendar();
cal.setTimeInMillis(DatePattern.sdf.parse(value).getTime());
this.accessed = new Long(cal.getTimeInMillis());
}
public void setAccessed(Long accessed) {
this.accessed = accessed;
}
public void setCreated(Long created) {
this.created = created;
}
@Override
public int hashCode() {
return (getId() != null ? getId().hashCode() : 0);
}
@Override
public Year clone() {
return new Year(this);
}
/**
* equals and hashCode need to be hammered out for hibernate to work
* properly
*
* Check the matrix summary for best practices at
* http://www.hibernate.org/109.html
*/
@Override
public boolean equals(Object rhs) {
if (this == rhs)
return true; // instance equality
if (rhs == null || getClass() != rhs.getClass())
return false; // null/class equality
final Year castedObject = (Year) rhs;
return !(getId() != null ? !getId().equals(castedObject.getId())
: castedObject.getId() != null);
}
public String toString() {
return getYearStart().toString() + "/" + getYearEnd().toString();
}
}
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
Here is the tml
<tr align="left">
<td align="center">
<select t:type="Select" t:id="yearSelect" t:clientId="yearSelect" id="yearSelect"
t:model="prop:yearSelectModel" t:encoder="prop:yearValueEncoder"
t:value="prop:year" blankOption="never"
/>
</td>
How do I know which valuencoder its using?
Why the NPE ?
Re: how to use HibernateEntityValueEncoder
Posted by "mailinglist@j-b-s.de" <ma...@j-b-s.de>.
Hi Ken!
Just a shot in the dark:
Are you sure the PKs of your hibernate beans are not null (maybe you have a newly created bean instance which is not persited yet)? Afair the HibernateValueEncoder requires properly filled PK fields otherwise pk.toString() fails. Unfortunately the stacktrace is difficult to read...
Jens
Sent from my iPhone
On 13.05.2013, at 21:00, Ken in Nashua <kc...@live.com> wrote:
> thanks guys... but I keep gettign an NPE
>
> @Persist
> @Property
> HibernateEntityValueEncoder<Year> yearValueEncoder;
>
> @Inject
> private ValueEncoderSource valueEncoderSource;
>
> @Inject
> private SelectModelFactory selectModelFactory;
>
> private ArrayList years;
>
> @SetupRender
> void setupRender() {
> years = new ArrayList(TynamoUTIL.loadCollection(hibernatePersistenceService, Year.class));
> yearSelectModel = selectModelFactory.create(years, "year");
> }
>
> my selectModelFactory fails
>
> Any ideas ?
>
> An unexpected application exception has occurred.org.apache.tapestry5.internal.services.RenderQueueExceptionRender queue error in SetupRender[pphl/Query]: org.apache.tapestry5.ioc.internal.util.TapestryExceptionactiveComponentspphl/Query (class org.tynamo.examples.pphl.pages.Query)org.apache.tapestry5.ioc.internal.util.TapestryExceptionjava.lang.NullPointerExceptionFilter stack frames
> Stack trace
>
> org.apache.tapestry5.internal.services.SelectModelFactoryImpl.create(SelectModelFactoryImpl.java:55)
>
> org.tynamo.examples.pphl.pages.Query.setupRender(Query.java:200)
>
> org.tynamo.examples.pphl.pages.Query.advised$setupRender_844d26137ccc(Query.java)
>
> org.tynamo.examples.pphl.pages.Query$Invocation_setupRender_844d26137ccb.proceedToAdvisedMethod(Unknown Source)
>
> org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:84)
>
> org.got5.tapestry5.jquery.services.ImportJQueryUIWorker$2.advise(ImportJQueryUIWorker.java:94)
>
> org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:86)
>
> org.tynamo.examples.pphl.pages.Query.setupRender(Query.java)
>
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.java:174)
>
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:133)
>
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.render(ComponentPageElementImpl.java:181)
>
> org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72)
>
> org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:124)
>
> org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37)
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: how to use HibernateEntityValueEncoder
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
By the way, do you really have an Year class? Why?
On Mon, 13 May 2013 16:00:50 -0300, Ken in Nashua <kc...@live.com>
wrote:
> thanks guys... but I keep gettign an NPE
>
> @Persist
> @Property
> HibernateEntityValueEncoder<Year> yearValueEncoder;
>
> @Inject
> private ValueEncoderSource valueEncoderSource;
> @Inject
> private SelectModelFactory selectModelFactory;
> private ArrayList years;
>
> @SetupRender
> void setupRender() {
> years = new
> ArrayList(TynamoUTIL.loadCollection(hibernatePersistenceService,
> Year.class));
> yearSelectModel = selectModelFactory.create(years, "year");
> }
>
> my selectModelFactory fails
>
> Any ideas ?
>
> An unexpected application exception has
> occurred.org.apache.tapestry5.internal.services.RenderQueueExceptionRender
> queue error in SetupRender[pphl/Query]:
> org.apache.tapestry5.ioc.internal.util.TapestryExceptionactiveComponentspphl/Query
> (class
> org.tynamo.examples.pphl.pages.Query)org.apache.tapestry5.ioc.internal.util.TapestryExceptionjava.lang.NullPointerExceptionFilter
> stack frames
> Stack trace
>
> org.apache.tapestry5.internal.services.SelectModelFactoryImpl.create(SelectModelFactoryImpl.java:55)
>
> org.tynamo.examples.pphl.pages.Query.setupRender(Query.java:200)
>
> org.tynamo.examples.pphl.pages.Query.advised$setupRender_844d26137ccc(Query.java)
>
> org.tynamo.examples.pphl.pages.Query$Invocation_setupRender_844d26137ccb.proceedToAdvisedMethod(Unknown
> Source)
>
> org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:84)
>
> org.got5.tapestry5.jquery.services.ImportJQueryUIWorker$2.advise(ImportJQueryUIWorker.java:94)
>
> org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:86)
>
> org.tynamo.examples.pphl.pages.Query.setupRender(Query.java)
>
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.java:174)
>
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:133)
>
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.render(ComponentPageElementImpl.java:181)
>
> org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72)
>
> org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:124)
>
> org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37)
>
>
>
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: how to use HibernateEntityValueEncoder
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
Please copy stack traces from the console, not the error page.
On Mon, 13 May 2013 16:00:50 -0300, Ken in Nashua <kc...@live.com>
wrote:
> thanks guys... but I keep gettign an NPE
>
> @Persist
> @Property
> HibernateEntityValueEncoder<Year> yearValueEncoder;
>
> @Inject
> private ValueEncoderSource valueEncoderSource;
> @Inject
> private SelectModelFactory selectModelFactory;
> private ArrayList years;
>
> @SetupRender
> void setupRender() {
> years = new
> ArrayList(TynamoUTIL.loadCollection(hibernatePersistenceService,
> Year.class));
> yearSelectModel = selectModelFactory.create(years, "year");
> }
>
> my selectModelFactory fails
>
> Any ideas ?
>
> An unexpected application exception has
> occurred.org.apache.tapestry5.internal.services.RenderQueueExceptionRender
> queue error in SetupRender[pphl/Query]:
> org.apache.tapestry5.ioc.internal.util.TapestryExceptionactiveComponentspphl/Query
> (class
> org.tynamo.examples.pphl.pages.Query)org.apache.tapestry5.ioc.internal.util.TapestryExceptionjava.lang.NullPointerExceptionFilter
> stack frames
> Stack trace
>
> org.apache.tapestry5.internal.services.SelectModelFactoryImpl.create(SelectModelFactoryImpl.java:55)
>
> org.tynamo.examples.pphl.pages.Query.setupRender(Query.java:200)
>
> org.tynamo.examples.pphl.pages.Query.advised$setupRender_844d26137ccc(Query.java)
>
> org.tynamo.examples.pphl.pages.Query$Invocation_setupRender_844d26137ccb.proceedToAdvisedMethod(Unknown
> Source)
>
> org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:84)
>
> org.got5.tapestry5.jquery.services.ImportJQueryUIWorker$2.advise(ImportJQueryUIWorker.java:94)
>
> org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:86)
>
> org.tynamo.examples.pphl.pages.Query.setupRender(Query.java)
>
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.java:174)
>
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:133)
>
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.render(ComponentPageElementImpl.java:181)
>
> org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72)
>
> org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:124)
>
> org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37)
>
>
>
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: how to use HibernateEntityValueEncoder
Posted by Ken in Nashua <kc...@live.com>.
thanks guys... but I keep gettign an NPE
@Persist
@Property
HibernateEntityValueEncoder<Year> yearValueEncoder;
@Inject
private ValueEncoderSource valueEncoderSource;
@Inject
private SelectModelFactory selectModelFactory;
private ArrayList years;
@SetupRender
void setupRender() {
years = new ArrayList(TynamoUTIL.loadCollection(hibernatePersistenceService, Year.class));
yearSelectModel = selectModelFactory.create(years, "year");
}
my selectModelFactory fails
Any ideas ?
An unexpected application exception has occurred.org.apache.tapestry5.internal.services.RenderQueueExceptionRender queue error in SetupRender[pphl/Query]: org.apache.tapestry5.ioc.internal.util.TapestryExceptionactiveComponentspphl/Query (class org.tynamo.examples.pphl.pages.Query)org.apache.tapestry5.ioc.internal.util.TapestryExceptionjava.lang.NullPointerExceptionFilter stack frames
Stack trace
org.apache.tapestry5.internal.services.SelectModelFactoryImpl.create(SelectModelFactoryImpl.java:55)
org.tynamo.examples.pphl.pages.Query.setupRender(Query.java:200)
org.tynamo.examples.pphl.pages.Query.advised$setupRender_844d26137ccc(Query.java)
org.tynamo.examples.pphl.pages.Query$Invocation_setupRender_844d26137ccb.proceedToAdvisedMethod(Unknown Source)
org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:84)
org.got5.tapestry5.jquery.services.ImportJQueryUIWorker$2.advise(ImportJQueryUIWorker.java:94)
org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:86)
org.tynamo.examples.pphl.pages.Query.setupRender(Query.java)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.java:174)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:133)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.render(ComponentPageElementImpl.java:181)
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72)
org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:124)
org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37)