You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Rajeev Chaudhary (JIRA)" <ji...@apache.org> on 2010/05/28 22:02:35 UTC

[jira] Created: (OPENJPA-1675) CreateQuery doesn't work when we don't define the classes in Persistance.xml in case of CMT(Container Managed Transaction)

CreateQuery doesn't work when we don't define the classes in Persistance.xml in case of CMT(Container Managed Transaction)
--------------------------------------------------------------------------------------------------------------------------

                 Key: OPENJPA-1675
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1675
             Project: OpenJPA
          Issue Type: Bug
         Environment: I have weblogic system libraries having javax.persistence_1.0.0.0_1-0.jar and org.apache.openjpa_2.2.0.0_1-1-0.jar. 
            Reporter: Rajeev Chaudhary


The entity classes need not be defined in persistance.xml, in case when the Container is handling the Entity and their transaction. I don't get issue when use find method of EntityManager. I get issue when using the CreateQuery method. could you please tell me why this is happening.

1.  <persistence-unit name="eclepJTA"> 
        <jta-data-source>eclep.jpa.DataSource</jta-data-source> 
        <class>org.wadsworth.check.dto.FacDto</class> 
  </persistence-unit> 

2. Base entity Class

@MappedSuperclass
public abstract class BaseFacDto implements  Serializable{
  -- all variables ---
}


3. Entity Class

@Entity
@Table(name="E_FAC")
public class FacDto extends BaseFacDto implements Serializable {
 -----All variables ----
}

4.  CreateQuery methods throws an error saying FacDTO is not recognied
List<FacDto> results = em.createQuery("SELECT f FROM FacDto f where f.facId IN ( '0240','2222','2343','4444') ").getResultList();

5. Find method works fine: 
  FacDto fac = em.find(FacDto.class, '0240')

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


[jira] Assigned: (OPENJPA-1675) CreateQuery doesn't work when we don't define the classes in Persistance.xml in case of CMT(Container Managed Transaction)

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

Rick Curtis reassigned OPENJPA-1675:
------------------------------------

    Assignee: Rick Curtis

> CreateQuery doesn't work when we don't define the classes in Persistance.xml in case of CMT(Container Managed Transaction)
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1675
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1675
>             Project: OpenJPA
>          Issue Type: Bug
>         Environment: I have weblogic system libraries having javax.persistence_1.0.0.0_1-0.jar and org.apache.openjpa_2.2.0.0_1-1-0.jar. 
>            Reporter: Rajeev Chaudhary
>            Assignee: Rick Curtis
>   Original Estimate: 20h
>  Remaining Estimate: 20h
>
> The entity classes need not be defined in persistance.xml, in case when the Container is handling the Entity and their transaction. I don't get issue when use find method of EntityManager. I get issue when using the CreateQuery method. could you please tell me why this is happening.
> 1.  <persistence-unit name="eclepJTA"> 
>         <jta-data-source>eclep.jpa.DataSource</jta-data-source> 
>         <class>org.wadsworth.check.dto.FacDto</class> 
>   </persistence-unit> 
> 2. Base entity Class
> @MappedSuperclass
> public abstract class BaseFacDto implements  Serializable{
>   -- all variables ---
> }
> 3. Entity Class
> @Entity
> @Table(name="E_FAC")
> public class FacDto extends BaseFacDto implements Serializable {
>  -----All variables ----
> }
> 4.  CreateQuery methods throws an error saying FacDTO is not recognied
> List<FacDto> results = em.createQuery("SELECT f FROM FacDto f where f.facId IN ( '0240','2222','2343','4444') ").getResultList();
> 5. Find method works fine: 
>   FacDto fac = em.find(FacDto.class, '0240')

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


[jira] Closed: (OPENJPA-1675) CreateQuery doesn't work when we don't define the classes in Persistance.xml in case of CMT(Container Managed Transaction)

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

Rick Curtis closed OPENJPA-1675.
--------------------------------

    Resolution: Cannot Reproduce

Closing this issue. 

If you have any questions try the users mailing list... but if you feel this is a bug, please reopen. 

> CreateQuery doesn't work when we don't define the classes in Persistance.xml in case of CMT(Container Managed Transaction)
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1675
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1675
>             Project: OpenJPA
>          Issue Type: Bug
>         Environment: I have weblogic system libraries having javax.persistence_1.0.0.0_1-0.jar and org.apache.openjpa_2.2.0.0_1-1-0.jar. 
>            Reporter: Rajeev Chaudhary
>            Assignee: Rick Curtis
>   Original Estimate: 20h
>  Remaining Estimate: 20h
>
> The entity classes need not be defined in persistance.xml, in case when the Container is handling the Entity and their transaction. I don't get issue when use find method of EntityManager. I get issue when using the CreateQuery method. could you please tell me why this is happening.
> 1.  <persistence-unit name="eclepJTA"> 
>         <jta-data-source>eclep.jpa.DataSource</jta-data-source> 
>         <class>org.wadsworth.check.dto.FacDto</class> 
>   </persistence-unit> 
> 2. Base entity Class
> @MappedSuperclass
> public abstract class BaseFacDto implements  Serializable{
>   -- all variables ---
> }
> 3. Entity Class
> @Entity
> @Table(name="E_FAC")
> public class FacDto extends BaseFacDto implements Serializable {
>  -----All variables ----
> }
> 4.  CreateQuery methods throws an error saying FacDTO is not recognied
> List<FacDto> results = em.createQuery("SELECT f FROM FacDto f where f.facId IN ( '0240','2222','2343','4444') ").getResultList();
> 5. Find method works fine: 
>   FacDto fac = em.find(FacDto.class, '0240')

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


[jira] Commented: (OPENJPA-1675) CreateQuery doesn't work when we don't define the classes in Persistance.xml in case of CMT(Container Managed Transaction)

Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12887808#action_12887808 ] 

Rick Curtis commented on OPENJPA-1675:
--------------------------------------

The 2.1.x user manual [1] states "Listing persistent classes (or their metadata or jar files) is an all-or-nothing endeavor. If your persistent class list is non-empty, OpenJPA will assume that any unlisted class is not persistent. " I don't recall how that plays with the </exclude-unlisted-classes> tag when running in the container, but can you try removing the line "<class>org.wadsworth.check.dto.FacDto</class>" to see if this fixes your problem?

For future reference, please wait to open a JIRA until we have concluded that this is indeed a bug. You will get a much more prompt response from the OpenJPA User List [2].

Thanks,
Rick

[1] http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_pc_pcclasses
[2] http://openjpa.apache.org/mailing-lists.html

> CreateQuery doesn't work when we don't define the classes in Persistance.xml in case of CMT(Container Managed Transaction)
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1675
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1675
>             Project: OpenJPA
>          Issue Type: Bug
>         Environment: I have weblogic system libraries having javax.persistence_1.0.0.0_1-0.jar and org.apache.openjpa_2.2.0.0_1-1-0.jar. 
>            Reporter: Rajeev Chaudhary
>   Original Estimate: 20h
>  Remaining Estimate: 20h
>
> The entity classes need not be defined in persistance.xml, in case when the Container is handling the Entity and their transaction. I don't get issue when use find method of EntityManager. I get issue when using the CreateQuery method. could you please tell me why this is happening.
> 1.  <persistence-unit name="eclepJTA"> 
>         <jta-data-source>eclep.jpa.DataSource</jta-data-source> 
>         <class>org.wadsworth.check.dto.FacDto</class> 
>   </persistence-unit> 
> 2. Base entity Class
> @MappedSuperclass
> public abstract class BaseFacDto implements  Serializable{
>   -- all variables ---
> }
> 3. Entity Class
> @Entity
> @Table(name="E_FAC")
> public class FacDto extends BaseFacDto implements Serializable {
>  -----All variables ----
> }
> 4.  CreateQuery methods throws an error saying FacDTO is not recognied
> List<FacDto> results = em.createQuery("SELECT f FROM FacDto f where f.facId IN ( '0240','2222','2343','4444') ").getResultList();
> 5. Find method works fine: 
>   FacDto fac = em.find(FacDto.class, '0240')

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