Re:override toString()

Guenter Wildmann <[email protected]> Fri, 11 Jun 2010 17:59:44 +0200
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <[email protected]>
Sorry for the late response, i have been away for a while.

If i have a table 'Template' with a primary key 'ID', the toString()
looks like

  public String toString() {
    return getString(ID);
  }

and i do a

  ses.findOrCreate(Template.TEMPLATE, "Template 1")

i get

   -findOrCreate [SRecM Template] {Template 1}
Exception in thread "main" java.lang.StackOverflowError
	at
simpleorm.dataset.SRecordInstance.isNotDestroyed(SRecordInstance.java:830)
	at
simpleorm.dataset.SRecordInstance.checkFieldIsAccessible(SRecordInstance.java:310)
	at simpleorm.dataset.SRecordInstance.getObject(SRecordInstance.java:305)
	at simpleorm.dataset.SRecordInstance.getString(SRecordInstance.java:485)
	at at.it_lab.uc4.installtool.db.Template.toString(Template.java:53)
	at java.lang.String.valueOf(String.java:2827)
	at java.lang.StringBuilder.append(StringBuilder.java:115)
	at simpleorm.dataset.SFieldScalar.getRawFieldValue(SFieldScalar.java:126)
	at simpleorm.dataset.SRecordInstance.getObject(SRecordInstance.java:306)
	at simpleorm.dataset.SRecordInstance.getString(SRecordInstance.java:485)
	at at.it_lab.uc4.installtool.db.Template.toString(Template.java:53)
	at java.lang.String.valueOf(String.java:2827)
	at java.lang.StringBuilder.append(StringBuilder.java:115)
......


Any ideas?

Ciao, Guenter





------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/SimpleORM/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/SimpleORM/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/