Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8814899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:14:36+00:00 2026-06-14T04:14:36+00:00

I have three classes which are connected to each other. Order, OrderDetail and Product.

  • 0

I have three classes which are connected to each other. Order, OrderDetail and Product. When I do in my JPA project the following:

 @Override
    public Order getOrderById(String orderID) {
        Order order = (Order)

          em.createQuery("select A from Order A where A.orderId = ?1")
            .setParameter(1, orderID)
            .getSingleResult();
        return order;    
    }

all the info is retrieved. However, when I move it to the ebj project. I only get Order and that’s it. All classes are however included in both the persistence.xml files (JPA and ejb3). Why is that and how should i solve it? The three classes are displayed underneath. I’m using Oracle Weblogic 10.3.3. I tried restarting and clearing the server but that didn’t work.

*package eshop;

import java.io.Serializable;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;*


/**
 * The persistent class for the orders database table.
 * 
 */
@Entity
@Table(name="orders")
public class Order implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @Column(name="order_id")
    private String orderId;

    @Column(name="cc_expiry")
    private String ccExpiry;

    @Column(name="cc_name")
    private String ccName;

    @Column(name="cc_number")
    private String ccNumber;

    @Column(name="delivery_address")
    private String deliveryAddress;

    @Column(name="delivery_name")
    private String deliveryName;

    @Column(name="delivery_surname")
    private String deliverySurname;

    private String status;

    //bi-directional many-to-one association to OrderDetail
    @OneToMany(mappedBy="order", cascade=CascadeType.PERSIST)
    private List<OrderDetail> orderDetails = new ArrayList<OrderDetail>();

    public void addOrUpdateOrderDetail(Product product) {
        this.orderDetails.add(new OrderDetail(product));


    }







    public Order() {
    }

    public String getOrderId() {
        return this.orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getCcExpiry() {
        return this.ccExpiry;
    }

    public void setCcExpiry(String ccExpiry) {
        this.ccExpiry = ccExpiry;
    }

    public String getCcName() {
        return this.ccName;
    }

    public void setCcName(String ccName) {
        this.ccName = ccName;
    }

    public String getCcNumber() {
        return this.ccNumber;
    }

    public void setCcNumber(String ccNumber) {
        this.ccNumber = ccNumber;
    }

    public String getDeliveryAddress() {
        return this.deliveryAddress;
    }

    public void setDeliveryAddress(String deliveryAddress) {
        this.deliveryAddress = deliveryAddress;
    }

    public String getDeliveryName() {
        return this.deliveryName;
    }

    public void setDeliveryName(String deliveryName) {
        this.deliveryName = deliveryName;
    }

    public String getDeliverySurname() {
        return this.deliverySurname;
    }

    public void setDeliverySurname(String deliverySurname) {
        this.deliverySurname = deliverySurname;
    }

    public String getStatus() {
        return this.status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public List<OrderDetail> getOrderDetails() {
        return this.orderDetails;
    }

    public void setOrderDetails(List<OrderDetail> orderDetails) {
        this.orderDetails = orderDetails;
    }

}


package eshop;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;


/**
 * The persistent class for the order_details database table.
 * 
 */
@Entity
@Table(name="order_details")
public class OrderDetail implements Serializable {
    private static final long serialVersionUID = 1L;

@GeneratedValue(strategy=GenerationType.AUTO)
private int id;

private BigDecimal price;

private int quantity;

//bi-directional many-to-one association to Order
@ManyToOne
@JoinColumn(name="order_id")
private Order order;

//bi-directional many-to-one association to Product
@ManyToOne
@JoinColumn(name="product_id")
private Product product;

@Id
private int product_id;

public OrderDetail() {
}

public OrderDetail (Integer ProductId,Product product,Integer productQuantity,BigDecimal price, Order order) {
        this.price= price;
        this.product_id = ProductId;
        this.product = product;
        this.quantity = productQuantity;
        this.order = order;
        }

    public OrderDetail(Product product1) {
    product_id = product1.getCategoryId();
    price = product1.getPrice();
    quantity  = 1;
    product = product1;

    }

    public int getId() {
        return this.id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public BigDecimal getPrice() {
        return this.price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public int getQuantity() {
        return this.quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public Order getOrder() {
        return this.order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }

    public Product getProduct() {
        return this.product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public int getProduct_id() {
        return product_id;
    }

    public void setProduct_id(int product_id) {
        this.product_id = product_id;
    }

}

package eshop;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;


/**
 * The persistent class for the products database table.
 * 
 */
@Entity
@Table(name="products")
public class Product implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @Column(name="product_id")
    private int productId;

    @Column(name="category_id")
    private int categoryId;

    @Lob
    private String descr;

    private BigDecimal price;

    @Column(name="product_name")
    private String productName;

    private int quantity;

    public Product() {
    }

    public int getProductId() {
        return this.productId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    public int getCategoryId() {
        return this.categoryId;
    }

    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }

    public String getDescr() {
        return this.descr;
    }

    public void setDescr(String descr) {
        this.descr = descr;
    }

    public BigDecimal getPrice() {
        return this.price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getProductName() {
        return this.productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public int getQuantity() {
        return this.quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:14:38+00:00Added an answer on June 14, 2026 at 4:14 am

    As it appeared I had to add transaction type JTA to the ejb’s web.xml file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my project I have the following three interfaces, which are implemented by classes
I have three classes: PurchaseOrder, PurchaseOrderLine, Item PurchaseOrder children are PurchaseOrderLine which is related
I have three classes: ClassA , ClassB , ClassC . ClassC extends ClassB which
I have an unmanged class and a ref class which ar logically connected: public
I have three classes which all make different works but I need to run
I have several classes which I connected to AngelScript engine. This engine uses interesting
I have a class Field of which there are two sub-classes AccountField and DecimalField
Have three classes User, Group and Field. Many to many relationship on User /
I have three classes that I am using and have shortened for ease of
I have three classes, I am simply display my Facebook friends in tableView. And

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.