You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Dinkar Rao (JIRA)" <ji...@apache.org> on 2008/07/17 21:01:36 UTC

[jira] Created: (OPENJPA-662) Version field returns null when explicitly projected in SELECT clause

Version field returns null when explicitly projected in SELECT clause
---------------------------------------------------------------------

                 Key: OPENJPA-662
                 URL: https://issues.apache.org/jira/browse/OPENJPA-662
             Project: OpenJPA
          Issue Type: Bug
          Components: query
            Reporter: Dinkar Rao
            Priority: Minor


With this entity:

An entity has a version field, with AUTO strategy.

@Entity
public class Department {
    @Id 
    private int id;
    
    @Version
    @GeneratedValue(strategy=GenerationType.AUTO)
    private int myVersion;
    
    private String name;
}

A record is inserted... 

		Department d = new Department();
		d.setName("SALES");
		em.getTransaction().begin();
		em.persist(d);
		em.getTransaction().commit();
		em.close();

...and queried. 

If the select is over the entity, "SELECT d from Department d", the version field is set up  correctly in the returned entity.

But if the version field is explicitly projected, "SELECT d.id, d.myVersion, d.name from Department d", the id and the name values are returned fine, but the myVersion value is null.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (OPENJPA-662) Version field returns null when explicitly projected in SELECT clause

Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pinaki Poddar reassigned OPENJPA-662:
-------------------------------------

    Assignee: Pinaki Poddar

> Version field returns null when explicitly projected in SELECT clause
> ---------------------------------------------------------------------
>
>                 Key: OPENJPA-662
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-662
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>            Reporter: Dinkar Rao
>            Assignee: Pinaki Poddar
>            Priority: Minor
>
> With this entity:
> An entity has a version field, with AUTO strategy.
> @Entity
> public class Department {
>     @Id 
>     private int id;
>     
>     @Version
>     @GeneratedValue(strategy=GenerationType.AUTO)
>     private int myVersion;
>     
>     private String name;
> }
> A record is inserted... 
> 		Department d = new Department();
> 		d.setName("SALES");
> 		em.getTransaction().begin();
> 		em.persist(d);
> 		em.getTransaction().commit();
> 		em.close();
> ...and queried. 
> If the select is over the entity, "SELECT d from Department d", the version field is set up  correctly in the returned entity.
> But if the version field is explicitly projected, "SELECT d.id, d.myVersion, d.name from Department d", the id and the name values are returned fine, but the myVersion value is null.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-662) Version field returns null when explicitly projected in SELECT clause

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods updated OPENJPA-662:
---------------------------------

    Fix Version/s: 2.0.0-M1

> Version field returns null when explicitly projected in SELECT clause
> ---------------------------------------------------------------------
>
>                 Key: OPENJPA-662
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-662
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>            Reporter: Dinkar Rao
>            Assignee: Pinaki Poddar
>            Priority: Minor
>             Fix For: 2.0.0-M1
>
>
> With this entity:
> An entity has a version field, with AUTO strategy.
> @Entity
> public class Department {
>     @Id 
>     private int id;
>     
>     @Version
>     @GeneratedValue(strategy=GenerationType.AUTO)
>     private int myVersion;
>     
>     private String name;
> }
> A record is inserted... 
> 		Department d = new Department();
> 		d.setName("SALES");
> 		em.getTransaction().begin();
> 		em.persist(d);
> 		em.getTransaction().commit();
> 		em.close();
> ...and queried. 
> If the select is over the entity, "SELECT d from Department d", the version field is set up  correctly in the returned entity.
> But if the version field is explicitly projected, "SELECT d.id, d.myVersion, d.name from Department d", the id and the name values are returned fine, but the myVersion value is null.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OPENJPA-662) Version field returns null when explicitly projected in SELECT clause

Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pinaki Poddar closed OPENJPA-662.
---------------------------------

    Resolution: Fixed

> Version field returns null when explicitly projected in SELECT clause
> ---------------------------------------------------------------------
>
>                 Key: OPENJPA-662
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-662
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>            Reporter: Dinkar Rao
>            Assignee: Pinaki Poddar
>            Priority: Minor
>
> With this entity:
> An entity has a version field, with AUTO strategy.
> @Entity
> public class Department {
>     @Id 
>     private int id;
>     
>     @Version
>     @GeneratedValue(strategy=GenerationType.AUTO)
>     private int myVersion;
>     
>     private String name;
> }
> A record is inserted... 
> 		Department d = new Department();
> 		d.setName("SALES");
> 		em.getTransaction().begin();
> 		em.persist(d);
> 		em.getTransaction().commit();
> 		em.close();
> ...and queried. 
> If the select is over the entity, "SELECT d from Department d", the version field is set up  correctly in the returned entity.
> But if the version field is explicitly projected, "SELECT d.id, d.myVersion, d.name from Department d", the id and the name values are returned fine, but the myVersion value is null.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.