Re: AW: persist.detail: "persistent" attribut value
Raoul Pierre <[email protected]>
| Newsgroups | gmane.comp.java.keel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello
About app-crud and persist.detail:
In org.keel.apps.crud.models.Query.listRecords(), we need to change
detCommand.setParameter(
"persistent",
oneRecord.getMetaData().getSchemaName() + "." + toName);
to
detCommand.setParameter("persistent", toName);
as "toName" already contains "schema.name" data from
Relation.getToPersistent()
As far as I tested there is nothing else to change.
Pierre
Gene a écrit :
> I don't actually use the details/Relations, but I do use
> persist-default service. This problem actually looks like it is a
> problem(?) with the way app-crud implements looking up the details.
> At line 312 of Query.java in app-crud, you'll see that it adds the
> schema name to the persistent to be looked up. The problem is that
> cascading deletes happen inside DefaultPersistentBase,
> deleteDetails(), where it tries to instantiate a persistent on only
> the persistent name (its assuming the schema.persistent naming is
> applied already).
>
> Not sure where the change needs to be made on this one...
>
> hth
> gene
>
> Raoul Pierre wrote:
>
>> Hello,
>>
>> with some delay, I come back about this point.
>>
>> I'm using default persistence service and app-crud with my own jsp
>> files (CVS from the ). If with Person class I define:
>>
>> * @persist.persistent
>> * schema="payroll"
>> * name="PN_person"
>> * descrip="Persistent person"
>> * table="T_person"
>> * * @persist.detail
>> * name="PD_worker"
>> * persistent="PN_worker"
>> * fromFields="PF_personId"
>> * toFields="PF_personId"
>> *
>> then erething runs fine but when I try to delate a Person record, I
>> get this error:
>>
>> [AbstractWebappClientConnector] Set working dir to 'C:\Program
>> Files\Apache Software Foundation\Tomcat 5.0\webapps\pop\WEB-INF'
>> 30 mars 2005 10:19:48 org.keel.clients.DefaultClientConnector logError
>> GRAVE: Stack for error from crud.payroll-delete-seq, Key: 'Database
>> error Message: Unable to instantiate detail db object 'PN_worker'Name
>> of Persistent must be of the form 'schema.name':'PN_worker'
>> org.keel.services.model.ModelException: Application Error
>> [...]
>>
>> So I add the schema:
>>
>> * @persist.detail
>> * name="PD_worker"
>> * persistent="payroll.PN_worker"
>> * fromFields="PF_personId"
>> * toFields="PF_personId"
>>
>> then deleting run fine but not the others commands. For example, when
>> I try to do a query from the person record list page I get this error:
>>
>> [AbstractWebappClientConnector] Set working dir to 'C:\Program
>> Files\Apache Software Foundation\Tomcat 5.0\webapps\pop\WEB-INF'
>> 30 mars 2005 13:19:51 org.keel.clients.DefaultClientConnector logError
>> GRAVE: Stack for error from crud.payroll-query-seq, Key: 'Exception
>> during model execution Message: Exception creating persistent
>> 'payroll.payroll.PN_worker'No meta-data definition for persistent
>> 'payroll' in factory 'default' in schema 'payroll'
>> org.keel.services.model.ModelException: Exception creating persistent
>> 'payroll.payroll.PN_worker'No meta-data definition for persistent
>> 'payroll' in factory 'default' in schema 'payroll'
>> at org.keel.apps.crud.models.CrudBase.execute(CrudBase.java:329)
>> [...]
>>
>> Quite a nice locking!
>>
>> So I have no choice: must try hibernate persistence service...
>>
>> Pierre
>>
>>
>>
>>
>>
>> Vidakovic Aleksandar a écrit :
>>
>>> The documentation might be a little bit outdated... I guess you
>>> already found the solution.
>>>
>>> Cheers,
>>>
>>> Aleks
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Raoul Pierre [mailto:[email protected]]
>>> Gesendet: Dienstag, 15. Februar 2005 13:08
>>> An: developers-6VIttnCrOeJXNEnpj1eHPNi2O/[email protected]
>>> Betreff: [Keelgroup] persist.detail: "persistent" attribut value
>>>
>>>
>>> Hello,
>>>
>>> About the "persistent" attribut value in @persist.detail, in
>>>
>>> Wiki
>>> (http://66.105.113.115/vqwiki-2.3.5/jsp/Wiki?DefaultPersistentXdoclet)
>>>
>>> it is stated that:
>>>
>>> "persistent: The name (the configuration name, including schema) of
>>> the persistent which holds the detail records for this master
>>> persistent"
>>>
>>> and the exemple is: persistent="poll.poll"
>>>
>>> But if I use there something like "payroll.worker", then I get
>>>
>>> http://localhost:8080/TEST/model.do?model=crud.payroll-query-seq&persistent=payroll.payroll.worker&personId=1
>>>
>>>
>>> that is twice "payroll" schema name. And it dosn't work.
>>>
>>> If I remove the schema name from the persistent attribut, eg
>>> persistent="worker", then everything is fine.
>>>
>>> Is it something (with or without schema name) you can choose? If
>>> yes, how?
>>>
>>>
>>>
http://keelframework.org/documentation.shtml
Keelgroup mailing list
[email protected]
http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com