Is the EJB Finder Find By Where supported?
I've been developing applications using JBOSS application server and it has Find-By-Where and Find-By-Where-Order-By as custom EJB finder options. This is where I can send in the where clause dynamically into the CMP layer and in the latter case order by a specific column set. I can't seem to do that in orion-ejb-jar.xml.
Is this a supported tag? If not can it be added?
Since the CMP EJBs Finders must be strictly defined ahead of time (unless you want to write the SQL your self - then why bother) on what you can and can't search on it's a real pain to add new parameters to searches. I've hacked it together and done a partial finder like this for now:
<finder-method partial="true" query="(number = $1 OR $1 IS NULL) AND (UPPER(last_name) LIKE $2||'%' OR $2 IS NULL) AND (UPPER(first_name) = $3 OR $3 IS NULL)>
Thanks,
Rich
Please look at a list on the Right side of the Forums Home page, Select Enterprise Java Beans from the list and press the GO button... You get the EJB forum list
Similar Messages
-
Using JNDI to make EJB Find MySQL DataBase
Hello, I'm new to EJB, and I'm trying to develop a Entity EJB which will retrieve data from a simple MySQL table. Though I'm getting this exception: javax.naming.NoInitialContextException
scale is the name of my DB.
try {
initialContext = new InitialContext();
Object homeObject = initialContext.lookup( "java:comp/env/jdbc/scale" );
exemploHome = ( EntityExemploHome )PortableRemoteObject.narrow( homeObject, EntityExemploHome.class );
}catch(NamingException namingException){
namingException.printStackTrace( System.err );
}I dont figure how this simple String should make the EJB find my database, i dont know if I deployed wrong (Used the deploytool). Further the code od the EJB Impl Class:
import java.sql.*;
import java.rmi.RemoteException;
import javax.ejb.*;
import javax.sql.*;
import javax.naming.*;
public class EntityExemploEJB implements EntityBean{
private EntityContext entityCont;
private Connection con;
private Integer condCNPJ;
private String condNome;
public Integer getCondCNPJ(){
return condCNPJ;
public void setCondNome( String nome ){
condNome = nome;
public String getCondNome(){
return condNome;
public Integer ejbCreate( Integer primaryKey )throws CreateException{
condCNPJ = primaryKey;
// INSERT
try {
Statement statement = con.createStatement();
String insert = "INSERT INTO Condominio (condCNPJ) VALUES ("+condCNPJ.intValue()+")";
statement.executeUpdate(insert);
return condCNPJ;
}catch ( SQLException sqlException ) {
throw new CreateException( sqlException.getMessage());
}//FIM ejbCreate
public void ejbPostCreate( Integer primaryKey ) {}
public void ejbStore() throws EJBException{// UPDATE
try {
Integer primaryKey = (Integer)entityCont.getPrimaryKey();
Statement statement = con.createStatement();
// create UPDATE statement
String update = "UPDATE Condominio SET condNome WHERE condCNPJ = "+primaryKey.intValue();
statement.executeUpdate(update);
}catch(SQLException sqlException){
throw new EJBException( sqlException );
}//FIM ejbStore
public void ejbLoad() throws EJBException{
try {
Integer primaryKey = (Integer) entityCont.getPrimaryKey();
Statement statement = con.createStatement();
String select = "SELECT * FROM Condominio WHERE condCNPJ = "+primaryKey.intValue();
ResultSet resultSet = statement.executeQuery(select);
if (resultSet.next()) {
condCNPJ = new Integer( resultSet.getInt( "condCNPJ" ));
condNome = resultSet.getString("condNome");
}else
throw new EJBException( "No such employee." );
}catch ( SQLException sqlException ) {
throw new EJBException( sqlException );
}//FIM ejbLoad
public Integer ejbFindByPrimaryKey(Integer primaryKey)throws FinderException, EJBException {
try {
Statement statement = con.createStatement();
String select = "SELECT condCNPJ FROM Condominio WHERE condCNPJ = "+primaryKey.intValue();
ResultSet resultSet = statement.executeQuery(select);
if(resultSet.next()){
resultSet.close();
statement.close();
return primaryKey;
}//throw ObjectNotFoundException if SELECT produces no records
else
throw new ObjectNotFoundException();
}catch ( SQLException sqlException ) {
throw new EJBException( sqlException );
}//FIM ejbFindByPrimaryKey
public void setEntityContext( EntityContext context )throws EJBException{
// set entityContext
entityCont = context;
try {
InitialContext initialContext = new InitialContext();
// get DataSource reference from JNDI directory
DataSource dataSource = ( DataSource ) initialContext.lookup( "java:comp/env/jdbc/escala" );
// get Connection from DataSource
con = dataSource.getConnection();
}catch ( NamingException namingException ) {
throw new EJBException( namingException );
}catch ( SQLException sqlException ) {
throw new EJBException( sqlException );
}//FIM setEntityContext
public void unsetEntityContext() throws EJBException{
entityCont = null;
// close DataSource Connection
try {
con.close();
}catch( SQLException sqlException ) {
throw new EJBException( sqlException );
}finally {
con = null;
}//FIM unsetEntityContext
public void ejbPassivate(){
condCNPJ = null;
// get primary key value when container activates EJB
public void ejbActivate(){
condCNPJ = ( Integer ) entityCont.getPrimaryKey();
public void ejbRemove() throws RemoveException{}
}//Fecha o EJBHi,
Which server r u using? I think u have not included the server jar file in u r classpath. for weblogic server, the look up should be like this.
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL,"t3://localhost:7001");
InitialContext ctx = new InitialContext(p);
Object obj = ctx.lookup("HelloBean");
regards
jogesh -
I'm trying to find instructions on replacing the memory module in an older MacBook (1,1). This is the model that has the removeable battery on the back. Anybody know where I can get this info? (It's not listed in the Apple Support info)
Video of the installation here:
http://eshop.macsales.com/installvideos/macbook_13_mem_hd/
MtD -
My iLife v9.03 Install disk is corrupt. Where can I find a download for the the app (not update) at apple support online ?
I have an iLife 11 disc that doesn't work very well so I tried creating a disk image of it with Disk Utility. It took two tries but finally got a disk image that I could use to install the iLife 11 applications. Give it a try.
OT -
i had lost the grey, round shaped rubber placed under my magic trackpad. i think it detached from the trackpad body and lost. where can i get this small spare part as i couldn't find this small spare part in apple store?
Wish I could be more positive but as far as I can see, the solution is to make something for yourself and tape it on. It appears they do not supply a proper replacement and Ifixit, the usual people say they don't have them.
Here is a company that supply rubber feet. It may be worth contacting them and asking if they have something that will do the job.
http://www.wowshop.co.uk/1%20inch%20rubber%20feet?_tt=g_1455876706_6722138569_56 292842294_c&gclid=COvs0q3pysECFavpwgodMU4APA -
I´m actually quite pissed off now... I´ve been trying to find Adobe Support or a telephone number to call, but all I can find is this Forum help site.
Problem:
I searched the web for the best photo editing software to be used with Mac. Adobe Photoshop Elements 13came up on top. I followed the links and clicked my way through the order process... When I was done, I see that I had purchased the software for Windows.
I wanted to call Adobe so I could change to Mac software, but can´t find out where to do this?? Now I am wasting a perfectly good morning trying to find contact information to Adobe.You can contact Adobe directly for a platform swap using the link below. Use the dropdown menu for boxes (1) & (2) to scroll down the list and choose:
1. Adobe Photoshop Elements
2. Adobe ID, and signing-in
3. Click on the blue button: Still need help? Contact us – then click the area marked chat 24/7, then click “start chat ”
It’s usually possible to start a live chat, if an Adobe agent is free, and often to get the problem fixed right away. Have your serial number available.
Click here to get help now Contact Customer Care -
I activated an iTunes gift card, my iPod showed the amount available ($15) then after downloading 2 songs my balance was $.04. Any ideas on what happened to the rest of my funds or how I can find out where the rest of my money went?
- Have youwent to yur iTunes account looked at your puchase history for purchases thant y might have forgotton?
- Maybe you had an unpaid balance before redeeming the card.
- Contact iTunes
Apple - Support - iTunes - Contact Us -
I just put Facetime on my MacBook and Ipad. I can connect and recieve video but no sound. The other person can hear me. If I use Skype everything works fine. I can't find any where in Facetime to change settings for the audio. Any suggestions
Options for when an iOS device gets locked because of forgotten passcode:
Restore (and reset passcode) on your device by connecting it to the last computer to which it was connected:
iTunes: Backing up, updating, and restoring iOS software - http://support.apple.com/kb/HT1414
If you cannot connect it to the computer to which the device was last connected (or the device was never connected to a computer) you will have to use recovery mode to completely reset the device, losing all data:
iOS: Unable to update or restore - http://support.apple.com/kb/HT1808 - recovery mode (e.g., cannot connect to computer last used to sync device, iTunes still asks for a password)
If recovery does not work there's:
DFU mode: http://osxdaily.com/2010/12/04/ipad-dfu-mode/
How to put iPod touch / iPhone into DFU mode - http://geekindisguise.wordpress.com/2009/07/16/how-to-put-ipod-touch-iphone-into -dfu-mode/ -
I am getting the PowerPC applications are no longer supported error, so I downloaded Libreoffice and can not find it on my hard drive anywhere. It did say it would install to Applications, but it's not there. How do I find it and can I put it in my dock?
In Safari's preferences:
Look in the folder displayed where you see the arrow. The actual Downloads folder is found in your Home (user) folder. -
I have lost my I phone5 amd I have enabled lost mode. But still I can't find out where it could be and I cloud search gives offline signal. If the thief turns on my phone is it possible to find out my phone or given any signal for me? is it possible for the thief to use or sell my I phone even it is on the locked mode by ICloud?
If it is turned on and your lock request is able to be fulfilled, a confirmation email will be sent to your Apple ID email address. There isn't any known way to bypass Activation Lock on your phone so no one will be able to use it. More information on Lost Mode: http://support.apple.com/kb/PH2700
-
I have Final Cut Pro X (10.0.9) and would like to change my project settings but I am having trouble finding the 'Modify Settings button.' Where exactly is it located? Here is the link which gives the instructions but doesn't seem to say where the 'Modify Settings Button' is located: http://support.apple.com/kb/PH12526?viewlocale=en_US
You have to choose – one settigf or another.
The thing is.your HD clips will look better in an SD project than your SD clips will in an HD project.
WIthout knowing much more about your project and the kind of content, it's really hard to be specific. But generally I'd let my project settings be guided by what fraction of my timeline will be made up of HD clips and how much SD clips. If it's 75% HD, I'd probably do an HD project…and so on,
Good luck.
Russ -
I rented a movie and the download was interrupted. Where can I find it again to resume the download?
Try the 'report a problem' page to contact iTunes Support : http://reportaproblem.apple.com
If the 'report a problem' link doesn't work then you can try contacting iTunes support via this page : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption -
I have the free trial photshop cc. where is the oil painting filter at? i cant find it
i have the free trial photshop cc. where is the oil painting filter at? i cant find it
As of CC 2014 the filter no longer exists. Several features were removed, some had to with flash as Adobe is supporting html5 over flash. It can still be used in CS6 and CC
-
how do i authorize my computer to download all my music for the store menu? and where do i find the store menu?
It should be at the top of your Mac's iTunes e.g.
And re-downloading : http://support.apple.com/kb/HT2519 -
I was robbed and I have the IMEI and I want to communicate with the company to find out where the iPhone
Having IMEI number cannot help you trace the iPhone.
If you have activated Find My iPhone and your iPhone is ON and have Internet access, you can locate it. Otherwise, report to the police, your carrier and change all passwords that were used i iPhone.
Lost or Stolen
http://support.apple.com/kb/HT2526
Maybe you are looking for
-
MDN Issue in AS2 adapter.. Seeburger experts., Need help
Hi All, Iam doing a scenario EDI-->Idoc for purchase order(ORDERS) by using AS2 adapter. We are expected to send the technical acknowledgment once we receive the Orders from sender. I think When we use the MDN (Message disposition notification), i wi
-
New fonts in Motion 5.1
In addition to the older built in fonts for FCPX/Motion, version 10.1 provides about 40 more fonts: AvenirBlackOblique.ttf AvianoSansBold.ttf Bank Gothic Light.ttf Bank Gothic Medium.ttf BasicCommercialLTCom-Bold.ttf BeaufortPro.ttf BebasNeue.otf Bra
-
Unable to deploy composite view to Web Dynpro for VC 7.1 SP3
I have a sandbox set up to explore VC 7.1 - currently using VC 7.0 extensively. I am using a very simple composite view example with a bapi, input and output form. The R/3 box is defined and the bapi test works fine. When XGL is selected as runtime
-
Recommended JVM Parameters for Master and ClientManager (v 6.1.0)
What are the recommened JVM parameters for a master and client manager running on the same Linux machine? Current VM Specs: OS: Suse Linux Processor Count: 4 Physical Memory: 8GB Using Java: jdk1.6.0_13 Current Master Params: JVMARGS=-Xms2048m -Xmx20
-
I accidentally set a remote mac to "remote management" while screen sharing. I did not realize that this set it to require the commercial Apple Remote Desktop application to get to it. Can I remotely reset it to screen sharing? It has disconnected me