Jas Singh

Greenhorn
+ Follow
since Jul 14, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Jas Singh

Hi Mylene,

Hope you must have sorted it by now. However I'm just posting the solution for future reference:

If you add the following code at lline 5 then it would list all the values from source list:


Hope it helps.

Cheers
JS
14 years ago
JSF
Dear Ranchers,
I am designing new application with EJB3.
I was just wonderning if its leagal and won't have any drawback.

@Remote
public interface OrderManagerRemote
{
public void addOrder(OrderTO orderData);
public List<OrderTO> getOrders();
}

@Local
public interface OrderManagerLocal extends OrderManagerRemote
{
//Only available in local interface.
public List<OrderTO> deleteOrders(List<OrderTO> orders);
}

I have tried this in Glassfish and it's working fine but I don't know what's going inside the system.

I could try other approach i.e.

public interface OrderMethods
{
public void addOrder();
}

@Remote
public interface OrderManagerRemote extends OrderMethods
{
}

@Local
public interface OrderManagerLocal extends OrderMethods
{
}
...but I just want to reduce the number of classes I'm creating.

Thanks in Advance.

[ July 31, 2008: Message edited by: Jas Singh ]
[ July 31, 2008: Message edited by: Jas Singh ]
Dear Ranchers,
I am new to JPA and currently working on a new project where we are using EJB3, JPA, Toplink, Glassfish, SQL Server 2005.

My use case is like this:
1. Order Table
2. OrderItems Table

1.Order:
ORDER_ID - PK, IDENTITY (Auto Generated key)
ORDER_TYPE
CREATION_DATE
SOME OTHER COLUMNS
2. OrderItems:
ID -PK, IDENTITY(Auto Generated)
ORDER_ID -FK, Ref: ORDER.ORDER_ID
ITEM_NAME
QTY
PEGGABLE
Other Columns.


Code Snippet (Please dont go on syntax etc as I am typing fom Home, where I dn't have access to Eclipse):
@Entity
public class Order
{
@Id
@Generated(generation Type=IDENTITY, cascade=CascadeType.PERSIST)
public int ORDER_ID;

@OneToMany (mappedBy="order")
public List<OrderItem> orderItems;

rest of the code for Order class.
}

@Entity
public class OrderItems
{
@Id
@Generated(generation Type=IDENTITY)
int ID;

@ManyToOne
@JoinColun(name="ORDER_ID", refrenceColumn="ORDER_ID")
Order order;
}

@Stateless
public class Client
{
public void addOrder()
{
Order order=new Order();
order.ORDER_TYPE=SOME_TYPE;
order.CREATION_DATE=new Date();

OrderItem item = new OrderItem();
item.ITEM_NAME="JPA Book";
item.QTY=1;
item.PEGGABLE=2;

List list = new ArrayList();
list.add(item);
order.orderItems=list;

em.persist(order);
}
}


TopLink Log:
INSERT INTO ORDER (ORDER_TYPE, CREATION_DATE, XYZ)
bind [SOME_TYPE, 28/07/2008 10:08PM, xyz]

INSERT INTO OrderItems (ORDER_ID, ITEM_NAME, QTY, PEGGABLE)
bind [null, JPA Book, 1, 2];


So the trouble is that ORDER_ID in OrderItems is coming as null value where I was expecting it to be the ORDER_ID of Order table.
Could you please suggest what could be missing in my code or any suggestion to get the ORDER_ID value in OrderItems table.

Thanks in advance.
[ July 28, 2008: Message edited by: Jas Singh ]
I had similar issue when my Glassfish start throwing similar exception.
I just undepoyed the application through admin console and clean the directories. Restarted server and deployed the ear and it worked for me.
Try this.
Good Luck.
Hi all,
I am designing a web site for a test centre in South Asia.

The broad overview of the web site:
Web site should be dynamic and support multi-languages (mainly south Asian)
Content managers should be able to choose the language and able to create/edit the content (Question and Answers).
Students should be able to choose the exam in their language (i.e. Hindi, Punjabi, Gujrati)
And all basic features like Profile, forum, notice broad, news etc etc.
As I have not worked on multi-language web site before so I have few questions regarding the design:
Do I have to have a Rich-Text editor for content managers to upload the content?
Should I use Language font�s or Unicode chars in this editor?
How should I store the content in the Database (Unicode/Binary)?
Shall I display the content in Unicode or raw data specifying language fonts?
If fonts are not available in students pc/laptop, do they have to download the fonts?
Is there any way of dynamically downloading the fonts? (@font-face url (xyz))
I shall be using following technologies on the website:
HTML, AJAX, PHP, MySQL 5x (UTF-8, binary supported)

I appreciate all your comments and time.
If possible can some body provide the examples or web links of same work.

Thanks in advance.

//JS
[ June 01, 2007: Message edited by: Jas Singh ]
Chaps,
I am preparing for SCWCD and SCDJWS.
Could you please suggest me some good books and websites?

Has anybody studied that book?
http://www.amazon.co.uk/gp/product/0321146182/202-8369683-3694212?v=glance&n=266239

Thanks in advance!
[ August 07, 2006: Message edited by: Jas S ]
Chaps,
I am preparing for SCWCD and SCDJWS.
Could you please suggest some good books and websites?

Thanks in advance!
[ August 04, 2006: Message edited by: Jas S ]
Big Hallo to all ranchers,
I am in a bit of dilemma and would like to ask whats the best way of cache Management for dynamic web pages which are updated every few minutes/hours e.g. news portal like BBC?
We are running few user facing eShops and have experienced slow performance with concurrent users. Earlier, we have had tried all sort of Apache and App-level cache and then build our own logic to cache the data at App Level, and we had wonderfull response but I am still looking for some best solutions.

Architecture:
Load Balancer
/ | \ \
Apache-1 Apache-2 Apache-3 Apache-3Static content
\ | |
App-Server-1 App-Server-2
| | !
DB-1 DB-2 DB-bkup

I might not have given full inforamtion so if you have some queries please feel free to post here.
All advices and queries appreciated.
[ August 01, 2006: Message edited by: Jas Saggu ]
18 years ago
Hi u all ranchers arnd...
I have just cleared my SCJP 1.4 exam.
I am a Web Service (Server Side) desiner/developer. What certificate will be best for me now?
All advices appreciated.
18 years ago