Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-478
Here is an overview of the issue:
---------------------------------------------------------------------
Key: CAY-478
Summary: Add the default constructor to the Entity class template
Type: Improvement
Status: Unassigned
Priority: Minor
Project: Cayenne
Components:
CayenneModeler GUI
Versions:
1.2 [DEV]
Assignee:
Reporter: Wonder World
Created: Mon, 13 Mar 2006 7:36 AM
Updated: Mon, 13 Mar 2006 7:36 AM
Environment: Windows.
Description:
To create a new Object need to do something like:
[code]myClass account = new myClass();
//or
myClass account =
(myClass)this.dataContext.createAndRegisterNewObject(myClass.class);
[/code]
My Class created by Cayenn GUI look
--------------------------------------
public MyClass extends....
{}
--------------------------------------
This will activate the proper constroctor, if doesnt exist, then the default one like "Which in my example doesnt exist."
public myClass()
{
Super();
}
After I knew that Cayenne *unfortunately* doesnt support the Default values of the DB(This is really another theme). i.e. Cayenne sends "NULL" value to db, i thought to use a custom Constroctur like this:
so my class looks like
--------------------------------------
public MyClass extends....
{
public myClass(DataContext dataContext)
{
Super();
dataContext.registerNewObject(this);
this.setDefaultValues();
}
}
--------------------------------------
The point is, adding a custom Constructor creates an error by using the
myClass account = new myClass();
Now the enhansment: I hope its possible to add the Default constroctor the the SubClass template. I added it here for me, but its very nice to have it as default, especially for newbis is very good help, and avoids unnecessary errors.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://objectstyle.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
This archive was generated by hypermail 2.0.0 : Mon Mar 13 2006 - 07:36:22 EST