[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-2299) Seam Generate Entities creates edit field for @Version annotated fields
by Dan Allen (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-2299?page=comments#action_12389762 ]
Dan Allen commented on JBSEAM-2299:
-----------------------------------
We could have it as read-only...the same logic would still apply with a little fudge. Personally, may feeling is that the version stuff should be hidden from the user. That's the whole point of optimistic locking. But, we could display it if its really necessary.
> Seam Generate Entities creates edit field for @Version annotated fields
> -----------------------------------------------------------------------
>
> Key: JBSEAM-2299
> URL: http://jira.jboss.com/jira/browse/JBSEAM-2299
> Project: JBoss Seam
> Issue Type: Bug
> Components: Tools
> Affects Versions: 2.0.0.GA
> Reporter: Thorsten Kunz
> Assigned To: Dan Allen
> Priority: Minor
> Fix For: 2.0.1.GA
>
> Attachments: JBSEAM-2299-v1.txt, JBSEAM-2299-v2.txt
>
>
> When you have an entity with a @Version annotation present (which is the default if you create it with "Seam Entity") and then run "Seam Generate Entities" on the project and select "use existing entities" the resulting CRUD pages will allow the version field to be edited. So you won't be able to create entities because the set accessor for the version was declared private in the entity. This renders the CRUD pages useless.
> I think this field should not be editable in the first place.
> Cheers, Thorsten
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 4 months
[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-2299) Seam Generate Entities creates edit field for @Version annotated fields
by Dan Allen (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-2299?page=all ]
Dan Allen updated JBSEAM-2299:
------------------------------
Attachment: JBSEAM-2299-v2.txt
second version of the patch ensures that it does not blow up when the version property is missing on the pojo
> Seam Generate Entities creates edit field for @Version annotated fields
> -----------------------------------------------------------------------
>
> Key: JBSEAM-2299
> URL: http://jira.jboss.com/jira/browse/JBSEAM-2299
> Project: JBoss Seam
> Issue Type: Bug
> Components: Tools
> Affects Versions: 2.0.0.GA
> Reporter: Thorsten Kunz
> Assigned To: Dan Allen
> Priority: Minor
> Fix For: 2.0.1.GA
>
> Attachments: JBSEAM-2299-v1.txt, JBSEAM-2299-v2.txt
>
>
> When you have an entity with a @Version annotation present (which is the default if you create it with "Seam Entity") and then run "Seam Generate Entities" on the project and select "use existing entities" the resulting CRUD pages will allow the version field to be edited. So you won't be able to create entities because the set accessor for the version was declared private in the entity. This renders the CRUD pages useless.
> I think this field should not be editable in the first place.
> Cheers, Thorsten
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 4 months
[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-2299) Seam Generate Entities creates edit field for @Version annotated fields
by Dan Allen (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-2299?page=all ]
Dan Allen updated JBSEAM-2299:
------------------------------
Fix Version/s: 2.0.1.GA
This is a must fix for 2.0.1.GA because it is so easy to do and it causes breakage of seam-gen applications for demonstrations.
> Seam Generate Entities creates edit field for @Version annotated fields
> -----------------------------------------------------------------------
>
> Key: JBSEAM-2299
> URL: http://jira.jboss.com/jira/browse/JBSEAM-2299
> Project: JBoss Seam
> Issue Type: Bug
> Components: Tools
> Affects Versions: 2.0.0.GA
> Reporter: Thorsten Kunz
> Priority: Minor
> Fix For: 2.0.1.GA
>
> Attachments: JBSEAM-2299-v1.txt
>
>
> When you have an entity with a @Version annotation present (which is the default if you create it with "Seam Entity") and then run "Seam Generate Entities" on the project and select "use existing entities" the resulting CRUD pages will allow the version field to be edited. So you won't be able to create entities because the set accessor for the version was declared private in the entity. This renders the CRUD pages useless.
> I think this field should not be editable in the first place.
> Cheers, Thorsten
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 4 months
[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-2299) Seam Generate Entities creates edit field for @Version annotated fields
by Dan Allen (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-2299?page=all ]
Dan Allen updated JBSEAM-2299:
------------------------------
Attachment: JBSEAM-2299-v1.txt
I can confirm that this happens when you run the following sequence of seam-gen commands:
./seam new-entity
./seam generate-ui
The UI generation is blind to the version property and unknowningly creates an input field for it. I have attached a patch which excludes the input field if the property is the version property, which is available on POJOClass
<#if property != pojo.versionProperty>
<#include "editproperty.xhtml.ftl">
</#if>
That, at least, fixes the breakage. Now the question is, should we hide the version property all together? That is another issue entirely. I am thinking we probably should. In that case, this logic is going to have to be applied deeper. But it is easy to do if you like looking a FreeMarker templates all day.
> Seam Generate Entities creates edit field for @Version annotated fields
> -----------------------------------------------------------------------
>
> Key: JBSEAM-2299
> URL: http://jira.jboss.com/jira/browse/JBSEAM-2299
> Project: JBoss Seam
> Issue Type: Bug
> Components: Tools
> Affects Versions: 2.0.0.GA
> Reporter: Thorsten Kunz
> Priority: Minor
> Attachments: JBSEAM-2299-v1.txt
>
>
> When you have an entity with a @Version annotation present (which is the default if you create it with "Seam Entity") and then run "Seam Generate Entities" on the project and select "use existing entities" the resulting CRUD pages will allow the version field to be edited. So you won't be able to create entities because the set accessor for the version was declared private in the entity. This renders the CRUD pages useless.
> I think this field should not be editable in the first place.
> Cheers, Thorsten
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 4 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1962) add default value expressions to EntityTransaction and HibernateTransaction
by Dan Allen (JIRA)
add default value expressions to EntityTransaction and HibernateTransaction
---------------------------------------------------------------------------
Key: JBSEAM-1962
URL: http://jira.jboss.com/jira/browse/JBSEAM-1962
Project: JBoss Seam
Issue Type: Feature Request
Components: Core
Affects Versions: 2.0.0.CR1
Reporter: Dan Allen
Priority: Minor
Fix For: 2.0.1.GA
The Seam CRUD framework uses the standard names entityManager for JPA and session for Hibernate when the name of the persistence context is not specified. However, EntityTransaction and HibernateTransaction components do not use default values. It seems like it would be beneficial to add default values to save a couple of keystrokes. I agree it is pretty minor, but as the Seam documentation says, and I quote "All those keystrokes add up!"
Assuming I have a managed persistence context named "entityManager"
Current:
<transaction:entity-transaction entity-manager="#{entityManager}" />
Desired:
<transaction:entity-transaction />
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 4 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2008) Query should use parameterized type for results
by Dan Allen (JIRA)
Query should use parameterized type for results
-----------------------------------------------
Key: JBSEAM-2008
URL: http://jira.jboss.com/jira/browse/JBSEAM-2008
Project: JBoss Seam
Issue Type: Feature Request
Components: Tools
Affects Versions: 2.0.0.CR1
Reporter: Dan Allen
Priority: Minor
Fix For: 2.0.0.GA
I don't see any reason why Query cannot be defined as Query<T, E> rather than Query<T>. The general design of Query is that it operates on a static base query (only the conditions are dynamic). Therefore, the item type in the result list should be anticipated. In any case, if it is not, you can always define it using the generic type Object.
To cite an example, we start with:
public class EntityQuery<E> extends Query<EntityManager, E> {}
We can use it as:
public class CategoryQuery extends EntityQuery<Category> {
}
CategoryQuery q = new CategoryQuery();
for ( Category c : q.getResultList() ) {
// didn't need to cast!
}
On the other hand, if the query component is defined without the type, it will still work. The type will be treated as java.lang.Object.
public class CategoryQuery extends EntityQuery {
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 4 months