</condition>
</fail>
<target depends="dist,javadoc" description="Build whole project." name="default"/>
- <!--
- INITIALIZATION SECTION
+ <!--
+ INITIALIZATION SECTION
-->
<target name="-pre-init">
<!-- Empty placeholder for easier customization. -->
<target name="-init-taskdefs">
<fail unless="libs.CopyLibs.classpath">
The libs.CopyLibs.classpath property is not set up.
-This property must point to
+This property must point to
org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
-of NetBeans IDE installation and is usually located at
+of NetBeans IDE installation and is usually located at
<netbeans_installation>/java<version>/ant/extra folder.
Either open the project in the IDE and make sure CopyLibs library
exists or setup the property manually. For example like this:
import javax.persistence.NoResultException;
import javax.persistence.Query;
import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
-import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean;
+import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean;;
/**
* A contact EJB
}
// Get query instance
- Query query = this.getEntityManager().createNamedQuery("SearchContactById", UserContact.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("SearchContactById", Contact.class); //NOI18N
// Set parameter
query.setParameter("contactId", contactId); //NOI18N
*/
package org.mxchange.jcountry.data;
+import de.chotime.jratecalc.database.BasePizzaDatabaseBean;
import java.text.MessageFormat;
import java.util.GregorianCalendar;
import java.util.List;
boolean isAdded = false;
// Get query instance
- Query query = this.getEntityManager().createNamedQuery("SearchCountryByCodeI18nKey", CountryData.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("SearchCountryByCodeI18nKey", Country.class); //NOI18N
// Assign all parameters
query.setParameter("code", country.getCountryCode()); //NOI18N
import javax.persistence.NoResultException;
import javax.persistence.Query;
import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
-import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean;
}
// Now find it
- Query query = this.getEntityManager().createNamedQuery("SearchCellphoneId", CellphoneNumber.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("SearchCellphoneId", DialableCellphoneNumber.class); //NOI18N
// Set parameter
query.setParameter("cellphoneId", cellphoneId); //NOI18N
}
// Try to locate it
- Query query = this.getEntityManager().createNamedQuery("SearchUserName", LoginUser.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("SearchUserName", User.class); //NOI18N
// Set parameter
query.setParameter("param", user.getUserName()); //NOI18N
}
// Create query instance
- Query query = this.getEntityManager().createNamedQuery("SearchUserId", LoginUser.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("SearchUserId", User.class); //NOI18N
// Set user id
query.setParameter("id", userId); //NOI18N
}
// Generate query
- Query query = this.getEntityManager().createNamedQuery("SearchUserId", LoginUser.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("SearchUserId", User.class); //NOI18N
// Set parameter
query.setParameter("id", user.getUserId()); //NOI18N
}
// Generate query
- Query query = this.getEntityManager().createNamedQuery("SearchUserId", LoginUser.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("SearchUserId", User.class); //NOI18N
// Set parameter
query.setParameter("id", userId); //NOI18N
}
// Generate query
- Query query = this.getEntityManager().createNamedQuery("SearchUserName", LoginUser.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("SearchUserName", User.class); //NOI18N
// Set parameter
query.setParameter("param", userName); //NOI18N
}
// Generate query
- Query query = this.getEntityManager().createNamedQuery("SearchEmailAddress", LoginUser.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("SearchEmailAddress", User.class); //NOI18N
// Set parameter
query.setParameter("param", user.getUserContact().getContactEmailAddress()); //NOI18N
}
// Generate query
- Query query = this.getEntityManager().createNamedQuery("SearchUserName", LoginUser.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("SearchUserName", User.class); //NOI18N
// Set parameter
query.setParameter("param", user.getUserName()); //NOI18N
import java.text.MessageFormat;
import java.util.List;
import javax.ejb.Stateless;
+import javax.persistence.NoResultException;
import javax.persistence.Query;
import org.mxchange.jcustomercore.model.customer.Customer;
import org.mxchange.jcustomercore.utils.CustomerUtils;
@Override
public String createCustomerNumber () {
// Init named query
- Query query = this.getEntityManager().createNamedQuery("SearchCustomerByNumber", RateCalcCustomer.class);
+ Query query = this.getEntityManager().createNamedQuery("SearchCustomerByNumber", Customer.class);
// Default is not found
String customerNumber = null;
// Search until a free number was found
while (null == customerNumber) {
// Create new number
- String cn = CustomerUtils.generateCustomerNumber(RateCalcAdminCustomerSessionBeanRemote.CUSTOMER_NUMBER_LENGTH);
+ String cn = CustomerUtils.generateCustomerNumber(PizzaAdminCustomerSessionBeanRemote.CUSTOMER_NUMBER_LENGTH, PizzaAdminCustomerSessionBeanRemote.CUSTOMER_NUMBER_BLOCK_SIZE, PizzaAdminCustomerSessionBeanRemote.CUSTOMER_NUMBER_SEPARATOR);
+
+ // Set the generated number as param
+ query.setParameter("customerNumber", cn);
+
+ // Try to find it
+ try {
+ // Get a single result
+ Customer customer = (Customer) query.getSingleResult();
+ } catch (final NoResultException ex) {
+ // Not found, okay
+ customerNumber = cn;
+ }
}
}
@Override
public Customer registerCustomer (final Customer customer) throws CustomerAlreadyRegisteredException {
- throw new UnsupportedOperationException("Registration by guests is not supported with RateCalc application."); //NOI18N
+ throw new UnsupportedOperationException("Registration by guests is not supported with Pizza application."); //NOI18N
}
}