From KDO-openJPA to eclipseLink problem.

1.static weaving,Entity's super class with @MappedSuperclass Annotation does't add the changeTracking in the class,but it can do in openJPA,although the eclipselink's document say it can,but it is't so
sample:
1.1EntityBase class
@MappedSuperclass
public abstract class EntityBase {
private String id;
@Id
@Column(name="ID")
public String getId() {
return id;
     @PrePersist
     private void prePersist() {
          if (getId() == null) {
               setId(generateUUID());
1.2 CodableEntity class
@MappedSuperclass
public abstract class CodableEntity extends EntityBase {
private String code;
@Column(name="CODE")
public String getCode() {
return code;
1.3 SampleEntity class
@Entity
@Table(name="T_Sample")
public class SampleEntity extends CodableEntity {
static weaving,the EntityBase and the CodableEntity hav't the changeTracking code.
I modify the eclipseLink1.0M10 source code.
org.eclipse.persistence.internal.weaving.TransformerFactory
* INTERNAL:
* Store a set of attribute mappings on the given ClassDetails that correspont to the given class.
* Return the list of mappings that is not specifically found on the given class. These attributes will
* be found on MappedSuperclasses.
protected List storeAttributeMappings(Class clz, ClassDetails classDetails, List mappings, boolean weaveValueHolders) {     
List unMappedAttributes = new ArrayList();
Map attributesMap = new HashMap();
Map settersMap = new HashMap();
Map gettersMap = new HashMap();
List lazyMappings = new ArrayList();
for (Iterator iterator = mappings.iterator(); iterator.hasNext();) {
DatabaseMapping mapping = (DatabaseMapping)iterator.next();
String attribute = mapping.getAttributeName();
AttributeDetails attributeDetails = new AttributeDetails(attribute, mapping);
// Initial look for the type of this attribute.
Class typeClass = getAttributeTypeFromClass(clz, attribute, mapping, false);
if (typeClass == null) {
attributeDetails.setAttributeOnSuperClass(true);
// if (mapping.getField() != null || mapping.isForeignReferenceMapping()) {
unMappedAttributes.add(mapping);
right??
2.OpenJPAQuery provider a method,setResultClass,i think it is very good,it can instance the class and fill the DB Result to Object by property/constructor,if it's map,it can put.
Message was edited by:
user646129

thanks your reply.
can eclipselink suport JPA query that select express with alias?
i.e
select o.id,o.name,o.level as manageLevel from xxx where o.id=?1
beacase my dto is a class,I hope the result can map to the class.
I have modied the openJPA1.0.2 and eclipseLink1.0M10 to add the feature,but I think if can support the feature the dto layer is simple.
below is My Modify.
1.JPQL.g
selectClause returns [Object node]
scope{
boolean distinct;
List exprs;
@init {
node = null;
$selectClause::distinct = false;
$selectClause::exprs = new ArrayList();
: t=SELECT (DISTINCT { $selectClause::distinct = true; })?
n = selectItem {$selectClause::exprs.add($n.node); }
( COMMA n = selectItem { $selectClause::exprs.add($n.node); } )*
$node = factory.newSelectClause($t.getLine(), $t.getCharPositionInLine(),
$selectClause::distinct, $selectClause::exprs);
selectItem returns [Object node]
@init { node = null; }
     : n = selectExpression {$node = $n.node;}
          ((AS)? ident = IDENT )?
if ($ident != null){
     $node = factory.newWithAlias($node, $ident.getText());
selectExpression returns [Object node]
@init { node = null; }
: n = pathExprOrVariableAccess {$node = $n.node;}
| n = aggregateExpression {$node = $n.node;}
| n = functionsReturningStrings {$node = $n.node;}
| n = functionsReturningDatetime {$node = $n.node;}
| OBJECT LEFT_ROUND_BRACKET n = variableAccess RIGHT_ROUND_BRACKET {$node = $n.node;}
| n = constructorExpression {$node = $n.node;}
| n = literal {$node = $n.node;}
2.antlr compile the JPQL.g
3.modify the org\eclipse\persistence\internal\jpa\parsing\jpql
3.1 and WithAliasNode interface
public interface WithAliasNode {
     * set the alias
     * @param alias
     public void setAlias(String alias);
     * get the alias
     * @return
     public String getAlias();
3.2 add WithAliasDotNode... class
public class WithAliasDotNode extends DotNode implements WithAliasNode {
     private String alias;
* INTERNAL
* Apply this node to the passed query
public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context) {
if (theQuery.isReportQuery()){
ReportQuery reportQuery = (ReportQuery)theQuery;
reportQuery.addAttribute(alias == null ? resolveAttribute() : alias, generateExpression(context));
reportQuery.dontRetrievePrimaryKeys();
     public String getAlias() {
          return alias;
     public void setAlias(String alias) {
          this.alias = alias;
In openJPA add the feature is very simple,but eclipselink ..,I think that if you can't suport the feature,please give me a extensible chance.

Similar Messages

  • After Migrating from 10g to 11g Geeting problems with Guided navigations.

    After Migrating from 10g to 11g Geeting problems with Guided navigations and section navigations not working.
    And we are getting the following error <<odbc driver returned an error (SQLExecDirectW)>> where we have used navigations.
    In 10G we have Guided navigation Reports to display the Reports links and intermediate reports for conditionally displaying the Dashboard section(Reports) but after migrating to 11g Guided navigation reports and conditional reports are not working..
    We know that in 11g section navigation replaced with conditions and Guided navigation replaced with action link.. but
    do we need to recreate those reports in actions and condition or is there any work around avoid reworking.

    Hi Both,
    Thanks for the reply ...
    For Guided navigation we are getting like below error:
    Odbc driver returned an error (SQLExecDirectW).
    For Conditional dashboard section we are getting like below error:
    "saw.aViewsToRefresh = [];saw.aViewsToRefresh['d:dashboard~p:1egt6il5utl0uu8n~s:3jsmgfs3c1r4tn7c~n:condition'] = true;saw.aViewsToRefresh['d:dashboard~p:1egt6il5utl0uu8n~s:nos5q43jvjmi643b~n:condition'] = true;"

  • I group messaged from my ipad and this has screwed up the way my messages are reveived by my friends (it creates new threads in their phones with my email in place of my contact name) I've stopped messaging from my ipad but the problem remains. Any help?

    I have an iPhone 4S and use the group texting feature ALL THE TIME. I recently updated my iPad to the latest software and made the colossal mistake of continuing my group messaging from my iPad while connected to wifi. Doing this has successfully screwed but every group text thread I am in, to the point where its very hard for those involved in the thread to keep up. When I initially messaged those I was already engaged in text threads with it created a new thread in their phones replacing my name in their phones with my email. At first this was not a big deal but ever since then the people I am messaging have become increasingly frustrated with how my messages come through. If I am messaged in a group text and respond to it, sometimes when I respond it will create an entirely different thread in my recipients phones. So at that point they have to switch threads in order to read what I wrote. The new thread that my phone creates will send the message under my email not my name (related to the contact they have me saved as in their phones). The worst part about it is that there seems to be no rhyme or reason to why or when my phone will send the message as normal or under my email like it did with my iPad. I haven’t messaged from my iPad since these problems immediately began a month ago but the issues still continue. I have tried everything to get this to stop, I’ve turned off my wifi, I’ve had my friends delete the threads that my messages create in their phones. I’ve had them delete my email in their contact lists and nothing has worked. Can you help me? Any info you could provide would be greatly appreciated.
    Note: My phone message no different whatsoever. All the threads have remained the same. The issue is what it is doing to the people that I am messaging.
        Best Regards
             Rick Mulhern
    Message was edited by: Rickapplehelp19

    I have this identical problem.  For a while my group texts didnt show up on my ipad.  Then one day they did, maybe everyone in the group started using the same os version or something.  Ever since my first reply to the group there have been complaints of multiple threads.  I can not find a pattern for when my group text's decide they want to create a new thread. (it doesnt happen every time)  Everyone in the group has deleted the thread, we've all toggled imessage on/off etc.  There still hasn't been a solution.
    Any help would be appreciated.
    Thanks

  • New browser window from CRM Web UI causes problems

    Hi Experts,
    We have several links to internal web sites that CRM users can access from the web UI.  Problem is, whenever one of these links are selected, the user looses whatever it was they were doing in CRM and the main window displays the following message:
    The object you have selected is starting in a new browser window. You can continue working normally in the current application. However, you may have to navigate back to the page you were working on.
    Anyway to prevent this from happening?   Would very much appreciate any advice.
    Thanks,
    Stephen Brewer

    Hello Brewer,
    If your requirement is to open some URL say google.com etc in a now window, then there are only 2 ways
    1) Use Transaction Launcher
    2) Use PopUp Window.
    1) If you use transaction launcher, and created the link in your direct link group then on click of the link, the URL will open in new window but you cant avaoid the message that you get in the current window. Also, if users POPUP Blocker is ON, user will never come to know why the new window has not launch.
    2) This is very simple and straight forward approch for opening URL. However, POPUP windows in WEB UI are modal windows, so say on click on a button on Account Overview Screen, i open google.com in a popup then unless i close this popup , i can not work on the account overview screen . However, you can see the account overview screen as it is and you can resume back when the popup is closed. Also you can define the even handler on close event of pop up so you can pass the data to & fro between the webclient view and the pop up.
    to open some extrenal URL in a PopUp , You will need to create a blank view and attach it to a window. In .htm file of the view, you can use tag IFRAME and call your external URL here.
    Hope its helpful.
    Thanks & Rregards
    Prasad
    PS : the popup blocked problem will still be there however, it flashes a message like pop up blocker is ON in case of using popup window

  • HT202157 my apple tv is disconnected from the wifi intermittently, the problem is not the wifi as it only happens to the apple tv. that I can do to fix this problem.-

    my apple tv is disconnected from the wifi intermittently, the problem is not the wifi as it only happens to the apple tv. that I can do to fix this problem.-

    That doesn't rule out a network issue, as it can impact devices differently. Intermittent issues are most often related to wifi issues. Try connecting via ethernet. Go to istumbler, netstumbler or similar to get a report of the network, look for signal strength and noise.

  • I have a MacBook Pro and OS10.6 and am trying to log into a site that requires me to enter a code from a picture ... problem is all I get on the screen is a white '?' in a blue box. What do I need to display the picture?

    I have a MacBook Pro and OS10.6 and am trying to log into a site that requires me to enter a code from a picture ... problem is all I get on the screen is a white '?' in a blue box. What do I need to display the picture?

    Reload the page. If it doesn't load, choose Activity from Safari's Window menu, find that picture in the list, and see what it says to the right; this may reveal what the problem is.
    (91827)

  • I have a problem in iphone4,i am from india and bought a new unlocked iphone4 from USA last month.the problem is when i call someone their is disturbance in the voice and i cant hear the opposite person voice.please inform me how should i overcome this?

    I have a problem in iphone4,i am from india and bought a new unlocked iphone4 from USA last month.the problem is when i call someone their is disturbance in the voice and i cant hear the opposite person voice.please inform me how should i overcome this?

    There may be a defect in the phone. As you bought it in the US the only place you can get it looked at is in the US.
    When you say you bought it new, unlocked did you buy it directly from an Apple store? If you did not it was hacked to unlock it, which could also be your problem. Apple stores are the only place in the US that sells legitimately unlocked iPhones.

  • Hi, I have problems in ordering book from iPhoto. It says "problems in getting contact with Apple Online Store" I have changed password on my Apple ID - could that be the problem ??

    Hi, I have problems in ordering book from iPhoto. It says "problems in getting contact with Apple Online Store" I have changed password on my Apple ID - could that be the problem ??

    Some additional efforts you can try:
    Go to the System/Sharing preference pane and make sure Remote Apple Events is checked.
    If it is, uncheck it and then recheck and try ordering again.
    OT

  • Trying to collect rewards from a survey site. told problem may be with the browser. I don't know what to do.

    trying to collect rewards from a survey site. told problem may be with the browser. I don't know what to do.

    Hi,
    Please [https://support.mozilla.org/en-US/questions/911441 see this.] You may also want to check if this happens in [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode.]

  • I have bought a iphone 4s from uk. but i face problem in using sim on it. this is updated with 6.0.1 version. this phone also hve a chip in sim plate. now how could i use it?

    i have bought a iphone 4s from uk. but i face problem in using sim on it. this is updated with 6.0.1 version. this phone also have a chip in sim plate. now how could i use it?

    Where did you purchase in UK and is the iPhone carrier locked ??

  • I have a problem with iPhone is that I can replace it at points of sale in the U.S. because I bought from Saudi Arabia because the problem I think in the hard ware software worked more than 3 times did not fix

    dears,
    I have a problem with iPhone is that I can replace it at points of sale in the U.S. because I bought from Saudi Arabia because the problem I think in the hard ware I do resoftware more than 3 times did not fix.
    Network also always missing.
    I am living in KS Wichita. I hope you help me pleas.
    Regards.

    iPhone warranty is not international. You will have to return your
    iPhone to Saudi Arabia for repair/replacement. Either take it back
    yourself or send to friend/relative for them to take to Apple. Apple
    will not accept international shipments for repair nor will Apple
    ship repaired/replaced iPhones out of the country where the repair
    was done.

  • I want to see a number with the name when one of my contacts calling me.., i just see his name...i am from egypt there is a problem with a country

    i want to see a number with the name when one of my contacts calling me.., i just see his name...i am from egypt there is a problem with a country

    If someone who is listed in your contacts calls you, you will only see their name. This has nothing to do with the fact you're in Egypt. The only workaround I can see for this is to put the person's number in the name section of the contacts. In other words, put their first and last name in the first name section and their phone number in the last name section.

  • I am English but I live in Spain. when I try to download an app now, as well as my password i get asked to complete a security question from a list. The problem is the list is in Spanish. How can I turn this additional security off

    I am English but I live in Spain. when I try to download an app now, as well as my password i get asked to complete a security question from a list. The problem is the list is in Spanish. How can I turn this additional security off.
    Please note: I dont speak Spanish.
    Please HELP

    You can't turn it off.

  • I want a solution to my problem and i hope to see any number to contact you for information i'm from saudi arabia and the problem has not been solved so far and i sent my problem via a Email twice before

    I want a solution to my problem and i hope to see any number to contact you for information i'm from saudi arabia and the problem has not been solved so far and i sent my problem via a Email twice before

    Most of the people on these forums, including myself, are fellow users - you aren't talking to iTunes Support here.
    Have you contacted iTunes Support as was suggested on your duplicate posts :
    https://discussions.apple.com/message/22178793#22178793
    https://discussions.apple.com/message/22178411#22178411

  • I have problems printing with a HP Officejet 6500 printer directly from my iMac. The printer itself does function well, as I can print from another PC without any problems. Does anyone have a clue?

    I have problems printing with a HP Officejet 6500 printer directly from my iMac. The printer itself does function well, as I can print from another PC without any problems. Does anyone have a clue?

    Hello:
    I must apologize  .  I should have checked here first:
    http://support.apple.com/kb/HT3669#HP
    According to the list, there is no driver for your printer included in OS X 10.7.
    There are a couple of options:
    1.  Contact HP to see if they have a workaround.
    2. If the model of printer is not listed but your printer is a PostScript printer or PCL Laser printer, try the "Generic PostScript" or "PCL Laser printer" drivers.  Generic printer drivers may not let you access all the features of your printer.
    I have not tried #2, but some people have had success.
    Barry

Maybe you are looking for

  • Paint over or replace color in a selected area - How?

    I was in the mountains taking photos yesterday. Unfortunately while I was there a rather pale blue sky turned grey. So I have a nice water fall and ugly white grey sky above it. I have PSE 9 and bought it for occasions just like this. Just downloaded

  • Wont open pdf files, print, and lags excessively

    pdf files show url but a completely black screen. when I hit Ctrl P, no print box comes up, nothing print. LAG. Worst ever! AND so many disabled add-ons. It wiped out my printer.

  • Yahoo email : How to sync more than 1 month?

    Is there a way to sync my entire Yahoo email Inbox? The max setting I can see on the S3 is for 1 month. Is there a way to avoid automatic deletions of Yahoo emails after this period? G

  • Request.setHeader in servlet filter

    Hi there, I am working on servlet filter to filter HttpServletRequest before sending it to the original servlet. The original servlet expects some content posted in the body of HttpServletRequest object. In my servlet filter, I need to modify this co

  • Get-ACL Error Continuation and Server List

    Hi All, I'm conducting an audit of all folders on network shares that are spread accross several servers.  I'm very new to PS but from my research I have put together the following: Get-ChildItem \\server\share -Recurse | Where-Object{($_.psiscontain