Friday, 15 August 2014

java - Convert List<Tuple> to List<Bean> -


I do not want to show all my attributes on a table, so I want to select only some columns then their values Map the bean, use some of Hibernate's transformers. Lius Tobin (T. Class) , but use JPA and Criteria.

Send me a list & lt; Tupal & gt; , I'll call it list & lt; T & gt; How can I change the form of

, as the title says, is it possible?

can argue object constructor within the query within JPQL / parameters so that the query returns those objects for you. . For example: "SELECT new package.BeanClass (e.attribute1, e.attribute2) Entity e"

With basic SQL queries, if you are using JPA 2.1, you can use the same example Constructor Silent can be used to build:

But if you are not able to use JPA 2.1, then you will need a provider-specific solution such as


PHP & MySQL - How to add images to query result? -


I am building a car rental system for school and I was thinking that I How to show the correct image of the car for the user when searching the database: For example:

The user wants to see all Toyota in Oslo with a picture of the picture in the car. The name of the picture is' ToyotaAvensensis. Jpg '

Now what I want is the image of the Toyota Evanescence display in the division that contains information about that particular car

I have images stored on my school FTP server and I Get information from a database

I get the search function to work with all the information and I'm just stuck on images like this

< Div class = "post-text" itemprop = "text">

A database in your database In the "Add Image" and enter related images every time the name you add a new unit in the database. You can name the pictures for a pattern after that, get the associated picture and display it with HTML.


actionscript 3 - AS3 Going to prevFrame from child -


OK, I have a problem changing the frame. (I would say that this step-by-step) was originally made from JPEG -> Movie Clip (Record), and I manually created the button in this movie clip. Then by Edchil (Record) in Mainclass, I added it on stage. Now I have made a functional button with modifications on the class records, and now by clicking on it I want to go to PrevFrame.

  Public Class Main Class MovieClip {var x: boolean = false; Static Var Ramka 3: Movie Clip; Public Function Mainclass () {stop (); This.addEventListener (Event.ENTER_FRAME, RRR); } Function rrr (): zero {if (x == false) {x = true; RAM 3 = new record (); RAM 3.x = Stage. Stagewidth / 20; Ram3.y = Stage. Stage High / 4; Ram3.width = stage.stageWidth / 1.1; RAM 3 Heights = stage. Stage high / 2; AddChild (record); }}  

Record category:

  expansion of public class record movie clip {public function record () {Restart.addEventListener (MouseEvent.CLICK, RestartGame) ; MainMenu.addEventListener (MouseEvent.CLICK, RestartGame); } RestartGame function (Event: MouseEvent): Zero {var button: DisplayObject = DisplayObject (event.currentTarget); If (button == restart) {Goto Andspot (2); // is nothing} if (button == main menu) {}}  


excel - VBA SysCmd Compile error (Sub or Function not defined) -


I am new to developing code for VBA, I am working on the function that runs with Excel document, The purpose is to upload the user credentials to pass the files SharePhase, when I compile it I error on SysCmd (not defined sub or function), please advise ... Thanks in advance.

is triggered by function Excel,

  public sub CopyToSharePoint () Error Goto err_Copy dim xmlhttp dim sharepointUrl dim sharepointFileName object as dim Tsin dim sBody dim LobjXML dim username string dim as PW string dim retval dim as I rounded as the date as integer dim early as dim TotFiles, end date set FSO as object as dim FSO = CreateObject ( "Scripting.FileSystemObjec t ") Dim Fldr in kind 'folder Set file as dim f object Fldr = fso.GetFolder (" c: \ vba2sharepoint \ ") username =" Mysharepointusername@domain.com "pw =" mysharepointpassword "Seyrpointuarel = "https://mysite.sharepoint.com/sites/xyz-uat/_layouts/15/start.aspx# / A1docsuat /" set LobjXML = CreateObject ( "Microsoft.XMLHTTP") TotFiles = fldr.Files.Count each f Fldr.files is in sharepointFileName = sharepointUrl & f.Name set Tsin = f.OpenAsTextStream sBody = tsIn.ReadAll tsIn.Close xmlhttp set = CreateObject ( "MSXML2.XMLHTTP.6.0") xmlhttp.Open "PUT", sharepointFileName, false, username, PW xmlhttp.Send sBody i = i + 1 retval = SysCmd (acSysCmdSetStatus, "file" & amp; I I & amp; & copy "of the" amp; TotFiles & amp; "...") set Next f retval = SysCmd (acSysCmdClearStatus) LobjXML = Nothing set FSO = nothing err_Copy: MsgBox Err & amp; "" & Amp; Err.Description If error & lt; & Gt; 0 Then MSBBF er and Android "" & Amp; Err.Description restart Next End then End Sub  

SysCmd < / Code> is an MS Access method (), not an Excel method.

You want to set the status bar text directly to a Application.StatusBar object as a pass string.

Modal msg like string msg = "new statebar" application. Statusbar = msg application. STATUSbar = "Other Text"

Either either of the previous two rows will be set to change the status bar text custom text, set it to vbNullString Please.

  Application.StatusBar = vbNullString  

View this Excel property reference.


sql - Show the previous date from an incomplete date list in MySQL -


I have a database where records are not kept every day, though I need to calculate balance changes between dates where There are records (except dates where there are no entries).

For example, I want to see such a result:

  trade_date balance prev_date prev_balance diff 2014-01-16 -2648 2014-01-13 436 -3084 2014-02 -04 37 2014-01-16 -2648 2685 2014-02-11 37 2014-02-04 37 2014-02-12 37 2014-02-11 37 2014-02-21 -9633 2014-02-12 37 -9670 2014-03-03 396 2014-02-21-9633 10029 2014-04-02 -10252 2014 -03-03 396 -10648 2014-04-03 -7033 2014-04-02 -10252 3219 2014-05- 21 -6849 2014-04-03 -7033 184 Unfortunately I do not know the interval between the present and the previous dates because it is always different so I can not do anything like this. Like DATE_SUB  

This is what I have done:

  from select * (select business_date, balance by table 1 order by business_date) d LEFT JOIN (choose business_date as prev_date, trade_data Balance as the balance before order of Table 2) a.prev_date & gt; D.business_date  

but it only returns a bunch of tap for the previous column.

All the things I have read on this topic include making dates for the table, but this will not work for me because my date list is incomplete, I only want to include dates whose We have records for

Any suggestion about accessing this will be very much in your first derived table 'D', generate a line number and include in:

To do this I have written this.

jquery - Amount field allowed - only digits 0-9, upto two decimal places and $ -


Hi - I have this Reggae which now gives the user only a key in -09 digits and two decimal places . What should be amended in this reggae to accept '$' also? [Example link for regex] [1]
regex: this.value = this.value.replace (/ ^ (\ d + \.? \ D? \ D?)?. * / G, '$ 1');

Follow your regex:

  ^ (\ d + \. \ D? \ D?)?. *  

You have to add the \ $ symbol like this:

  ^ (\ $ \ D + \.? \ D? \ D?)?. * ^ --- Here, and avoid the character  

BTW, if you do not want to capture Dadar, you can do the symbol:

  ^ (\ $ \ D + \.? \ D? \ D?) ?. *  

MySQL: Trigger to Insert New Row in One Table When Another Table has a Row Inserted -


I want to insert a new line in an existing table, when the row is inserted in another table. There are many examples of this, though I am not able to find anyone with a trigger. Here's my code. What am I doing wrong? Trigger is not just firing:

  USE 'MTFDFRF'; Each line inserted in delimiters $$ `StationTrouble` (` _rowid_`, `fullname`,` username`, `email5`,` controlnumber````````````` for `problemdescription`, then insert the insert trigger on` StationTrouble_temp` Select 'StationTrouble_temp`, `appaerentcause`,` observed`, `reportstatus`,` _submitted_`, `_fromaddress_`,` _flags_`, `_transactid_`,` submittername`, `other submitter`) rowid_, full name, user Name, email5, controlnumber, station, problemdescription, appaerentcause, celebrated, reportstatus, _submitted_, _fromaddress_, _flags_, _transactid_, submittername, othersubmitter from StationTrouble_temp;  

You use the new keyword to enter new ones If the trigger where the trigger is executed, then it should be

in the form from
  Delimiter $$ to create a trigger trigger on `StationTrouble_temp` after each line` `StationTrouble_temp` StationTrouble` starts entering (`_rowid_`,` fullname`, `username`,` email5`, `controlnumber`,` station`, `problemdescription`,` appaerentcause`, `observed`,` reportstatus`, `_submitted_`, `_fromaddress_`,` _flags_`, `_transactid_`, 'submit,', 'other Google 'value (new.rowid_, new.fullname, new.username, new.em) Ail5, new.controlnumber, new.station, new.problemdescription, new.appaerentcause, new.observed, new.reportstatus, new._submitted_ , New._fromaddress_, new._flags_, new._transactid_, new.submittername, new.othersubmitter); End ; $$