zwwcn

Just another WordPress.com site

Monthly Archives: April 2011

fireblureevent: ajax call

wait ajax redering the page

invoicePage.invoiceItemTable.getPrice(0).type(“1.00”);
invoicePage.invoiceItemTable.getPrice(0).fireBlurEvent();
invoicePage.invoiceItemTable.getPrice(0).waitFor(2000);

Advertisements

Selenium exception: element is undefined

avoid to read the same field twice

replace

Assert.assertEquals(“expected  Windscreen Servicing got ” + leadpage.leadList.getEvent(0)   , “Windscreen Servicing” , leadpage.leadList.getEvent(0));

with

String event = leadpage.leadList.getEvent(0);

Assert.assertEquals(“expected  Windscreen Servicing got ” + event   , “Windscreen Servicing” ,event);

JPA “Where IN” clause

update Offer o SET o.hidden = true WHERE o.type= :test1 AND o.store.id IN (:test2)

A collection with cascade=”all-delete-orphan” was no longer referenced by the owning entity instance

The logged exception

org.hibernate.HibernateException – “A collection with cascade=”all-delete-orphan” was no longer referenced by the owning entity instance: com.onkarjoshi.hibernate.test.Person.children”

Your likely problem

Looks like you have a Parent entity and a Child entity. The Parent has a collection of Child entities with cascade=”all-delete-orphan”.

You are setting a new collection via the setter thus leaving the original collection unreferenced by the Parent entity. This doesn’t fly well with Hibernate and leaves it confused about what to do.

parent.setChilden(new HashSet<Child>()); // This won’t work. Could be an ArrayList too.

parent.getChildren().clear(); // There, fixed that!

So generally speaking, just clear out the old collection, rather than dereferencing it and creating a new one.

from:http://www.onkarjoshi.com/blog/188/hibernateexception-a-collection-with-cascade-all-delete-orphan-was-no-longer-referenced-by-the-owning-entity-instance/

OneToOne unidirectional mapping


public class ReportMetricCategory{

@OneToOne
@JoinColumn(name="REF_ACCOUNT_ID", nullable = true)
private Account referenceAccount;

@Column(name = "CATEGORY_NAME",nullable = false, length = 127)
private String categoryName;

....

Add  account_id in report metric category table. we do nothing in account table.

Use “@JoinColumn” when mapping entity,  “@Column” for mapping normal property.

If test in Rich:column

</code>

<rich:dataTable id="reportList" var="rept" value="#{reportList}" renderedIfEmpty="false" preserveDataModel="false"
rowClasses=",alt" styleClass="" width="100%">
<rich:column styleClass="paddingleft12" headerClass="paddingleft12">
<f:facet name="header">Report Name</f:facet>
<ui:fragment rendered="#{rept.reportName!='Sales And Royalty'}">
<s:link id="view" action="#{reportListAction.selectReport}" value="#{rept.reportName}">
</s:link>
</ui:fragment>
</rich:column>
</rich:dataTable>

<code>

http://www.ilikespam.com/jsf/c:foreach-vs-ui:repeat-in-facelets

java test

sdfsdf

Hello world!

Welcome to WordPress.com. After you read this, you should delete and write your own post, with a new title above. Or hit Add New on the left (of the admin dashboard) to start a fresh post.

Here are some suggestions for your first post.

  1. You can find new ideas for what to blog about by reading the Daily Post.
  2. Add PressThis to your browser. It creates a new blog post for you about any interesting  page you read on the web.
  3. Make some changes to this page, and then hit preview on the right. You can alway preview any post or edit you before you share it to the world.