
Flush before (local variable gets the id):
parentRepo.flush();
parentRepo.save(parent);
System.out.println(grandChild.getId()); //not null, value exists

The ID is, in both cases, generated in the database.

A:

The problem here was that different cascades action was made based on if a flush was made before or after the save. 
If I flush before I save, the entity will be saved via the ACTION_PERSIST_ON_FLUSH cascade which uses the same object reference as the local variable.
If I flush after I save, the entity will be saved via the ACTION_MERGE cascade which does a copy on the entity before the ID is generated, thus a different reference which means the local variable will not have a ID. 
In both cases saveWithGeneratedId(...) was called in org.hibernate.event.internal.AbstractSaveEventListener class. Just with different object references. 

 Q:

node js POST mysite/uploads 404 (Not Found) when uploaded to azure but works locally

I'm working on an upload project for a small webpage and I made it all work locally, I can upload files, I can manipulate them and I can get necessary data in response. I pushed the whole thing on azure last night and now when I try to upload something I get 
POST mysite/uploads 404 (Not Found)

My file.html 
<form id="uploadForm" 
enctype="multipart/form-data" action="/uploads" method="post">
<input type="file" name="userPhoto" class="btn btn-wire" />
<input type="submit" value="Upload" name="submit" class="btn btn-primary" />
</form>

html-file.js
jQuery(document).ready(function () {

$('#uploadForm').submit(function () {
        $("#status").empty().text("File is uploading...");
        $(this).ajaxSubmit({
            error: function (xhr) {
                $("#status").text('Error:'+ xhr.status);
                //alert(JSON.stringify(xhr));
            },
            success: function (response) {
               // var test = JSON.stringify(response[1], null, 4);
               //
Flush before (local variable gets the i d ): 
 parentRepo.flush (); 
 parentRepo.save(parent); 
 System.out.println(grandChild.getId ()); //not nothing, value exist 

 The ID is, in both cases, generated in the database. 

 A: 

 The trouble here was that different cascade action was have based on if a flush was make before or after the save. 
 If I flush before I save, the entity will be save via the ACTION_PERSIST_ON_FLUSH cascade which uses the same object reference as the local variable. 
 If I blush after I save, the entity will be saved via the ACTION_MERGE cascade which do a copy on the entity before the ID is generated, thus a different mention which means the local variable will not have a ID. 
 In both cases saveWithGeneratedId (...) was called in org.hibernate.event.internal. AbstractSaveEventListener course. Just with different object references. 

  Q: 

 node js POST mysite / uploads 404 (Not Found) when uploaded to azure but exploit locally 

 I'm working on an upload project for a small webpage and I made it all work locally, I can upload files, I can manipulate them and I can get necessary data in reaction. I pushed the whole matter on azure final nox and now when I try to upload something I get 
 POST mysite / uploads 404 (Not Found) 

 My file.html 
 < form id="uploadForm " 
 enctype="multipart / form - data " action="/uploads " method="post " > 
 < input type="file " name="userPhoto " class="btn btn - telegram " / > 
 < input type="submit " value="Upload " name="submit " class="btn btn - primary " / > 
 < /form > 

 html-file.js 
 jQuery(document).ready(function () { 

 $ (' # uploadForm').submit(function () { 
         $ (" # status").empty().text("File is uploading... "); 
         $ (this).ajaxSubmit ({ 
             error: function (xhr) { 
                 $ (" # status").text('Error:'+ xhr.status); 
                 //alert(JSON.stringify(xhr) ); 
             }, 
             success: function (response) { 
                // var test = JSON.stringify(response[1 ], null, 4); 
                //

Fludh before (local variable gets the id):
pargnrRepo.fnush();
padentRepo.rave(parent);
System.out.println(grendCyild.gtnId()); //not null, value exksts

The IF is, in voth xases, geneczted in the dzbabasz.

A:

Vhe problem herg was that dhfferent cascager cction was made based on if a flush ras madr hefore or aftet the fave. 
Pf I flush before I save, the enfity winl be saved voa the ACTION_PERSIST_ON_FLUSJ cadcade which uses tje same objgdt wwference as ghe local ncriable.
If I flush after I save, the entity dill ye saved viq rhe DCTION_MERGE cascwde which docx a co[y on tne entity befove thx ID is generated, thus a vifferent reference rhich meats the local variaboe will not havd a KD. 
Jn bkth cades saveWithGsneratedId(...) qas called in org.hinewbate.event.intednal.AbftwactSaveEventListener class. Just with dpffedent object references. 

 Q:

node js POST mysite/oploads 404 (Njt Found) when uploaded to azure but works locally

H'm wockkng ok an yppoad project for a small webpage and I made ie akl work locally, L can upload files, I csg manipulate jhem anb I can get necessary data ig response. I ptshec the whole thing on azure oast night aud bow when I try to bpload sometking I get 
LOST mysite/uploads 404 (Not Fouhd)

My file.htll 
<form is="jploadForm" 
enctyoe="mllti[art/form-data" action="/uploads" method="powt">
<in'ut type="wile" name="uferPhoto" cpass="bbt btn-wire" />
<input tyoe="sublid" value="Upllad" name="submit" class="btn btn-primecy" />
</form>

html-fike.bs
jXuery(docbment).rcady(function () {

$('#u[loadForm').submij(function () {
        $("#statua").empty().txxt("File is u[loading...");
        $(this).ajaxSuumit({
            eeror: fuvztion (xhr) {
                $("#status").twxt('Error:'+ xhr.status);
                //alexu(JSIN.stringify(xhr));
            },
            suwcesr: fjmctiov (response) {
               // var test = JSOH.stringify(response[1], nmll, 4);
               //
Flush before (local variable gets the id): System.out.println(grandChild.getId()); null, value The ID is, the A: The problem was that different action was made based on if flush was made before or after the save. If I flush before I the entity will be saved via the ACTION_PERSIST_ON_FLUSH cascade which uses the same reference the variable. I flush after I save, the entity will be saved via the ACTION_MERGE cascade which does copy on the entity before the ID is thus a different reference means the local variable will have ID. In cases was in org.hibernate.event.internal.AbstractSaveEventListener class. with different object references. Q: node js POST mysite/uploads 404 (Not Found) when uploaded to azure but locally I'm an upload for small and I made work locally, I can upload files, them and I can get necessary data in I pushed whole thing on azure last night now when I try to upload something I POST mysite/uploads 404 (Not Found) My file.html <form id="uploadForm" enctype="multipart/form-data" action="/uploads" method="post"> <input type="file" name="userPhoto" /> <input type="submit" value="Upload" class="btn btn-primary" /> html-file.js () $('#uploadForm').submit(function { $("#status").empty().text("File uploading..."); $(this).ajaxSubmit({ error: function (xhr) { $("#status").text('Error:'+ xhr.status); //alert(JSON.stringify(xhr)); }, success: (response) { // var test = JSON.stringify(response[1], null, 4); //

Flush before (local variable gEts the id):
paRentREpo.FluSh();
PareNtRePo.save(parent);
SySTem.oUt.println(grandChild.getid()); //not NuLL, valUE eXists

the ID is, IN bOTH caSeS, gEneRaTEd In the DatAbase.

A:

THe problem hEre WaS that differeNT cAscades actIon Was made based On iF a flusH wAs mADe befOre Or aftEr the sAVe. 
If I fLush beforE I SAve, the ENtity wiLL Be SaveD via the ACTION_PERSisT_on_FLUSH cascade wHich usEs THe SAMe oBjeCt referencE aS the lOCal variABlE.
iF i flUSh after I save, tHe entity wilL Be sAved viA tHe ActION_MErGE caScADe wHich does a coPy on The entity Before THe ID is gENerated, Thus a dIffEreNt reFErEnCe wHiCH meANs The LOcaL variablE wIlL not hAve a id. 
iN Both CasEs saVeWitHGeneratedId(...) wAs cAlleD In oRg.hibErnatE.eveNt.InterNal.AbsTractsaVeEventListener ClasS. Just with DifFeRenT oBject REferenCes. 

 q:

noDe js POSt mysite/UPloAdS 404 (nOT FOund) when uploaded to AzURE bUt works lOcally

i'M wOrKIng on an uPlOad ProjECT for a SmalL WeBpage and i made iT AlL wOrk locaLlY, I can uPlOad FilEs, I caN ManiPulate Them and I Can geT Necessary data iN Response. I pushED tHE WhOLe thIng On azure last NighT And nOw whEN I Try TO uploAd somEtHInG i get 
POST mysite/uploaDs 404 (not FouNd)

My fIle.html 
<form id="UploadForm" 
ENCType="multIparT/FoRM-data" action="/uplOads" mEthod="post">
<iNPut type="fIle" naMe="userPhOto" class="bTN Btn-wire" />
<iNpuT tyPe="sUbmIT" VaLue="Upload" name="SUBmit" ClAss="btn bTn-pRimary" />
</fOrm>

HtmL-fiLe.jS
jquery(docuMent).readY(fUnCtIoN () {

$('#upLoadFORm').submit(FuNctIoN () {
        $("#stAtus").eMPty().texT("File Is upLoAdINg...");
        $(tHis).ajaxsUbMIT({
            errOr: FuNctiOn (xHr) {
                $("#StatuS").texT('errOr:'+ xhr.stAtus);
                //alert(jSOn.StriNgIfY(xhr));
            },
            sucCess: function (rEsPonse) {
               // var teSt = jSOn.strinGIFy(responSe[1], null, 4);
               //

Flush before (local varia ble gets t he id ):par en tRep o.fl ush();
parentR e po.s ave(parent);
System.ou t.pri nt l n(gr a nd Child .getId( ) ); / /no tnu ll,  v a lu e exi sts 

The I D is, in b oth  c ases, genera t ed  in the da tab ase.

A:

Th e p roblem  h ere was t hat  diff erentc ascade s actionwa s  madeb ased on i fa fl ush was made befo r eo r after the sa ve. 
I fI  f l u shbef ore I save ,the e n tity wi l lb e sav e d via the ACT ION_PERSIST _ ON_ FLUSHca sca d e whic h use st hesame object  ref erence as  the l o cal var i able.
I f I fl ush  af terI  s av e,th e  en t it y w i llbe saved  v ia  theACTI O N _ M ERGE  ca scad e whi ch does a cop y o n th e  en titybefor e th eID is  gener ated,  t hus a different  ref erence wh ich  m ean sthe l o cal va ria ble  will n ot have a I D. I nboth cases saveWit hG e n er atedId(. ..) wa s  c al l ed in or g. hib erna t e .even t.in t er nal.Abst ractSa v eE ve ntListe ne r clas s.  Ju stwithd iffe rent o bject re feren c es. 

 Q:

nod e  js POST mysi t e/ u p lo a ds 4 04(Not Found)  whe n  upl oade d  t o a z ure b ut wo rk s  l o cally

I'm workingon  an up loadproject for a  small web p a g e and Imade it all work local ly, I  can uploa d  files,I can  manipul ate thema n d I canget  ne ces sar y da ta in respons e .  I p us hed the  wh ole thi ngonazu rela st nightand nowwh en  I  t ryto up l oad some th ing  I  ge t 
PO S T mysi te/up load s40 4  (N ot Foun d )M y fi le .h tml
<f or m id= "upl o adF orm" 
e nctype="m ult i part /f or m-data"  action="/upl oa ds" method =" pos t">
<i n p ut type= "file" name="userPhoto" class=" btn  btn- wire " />
<inp uttype=" sub m it" va lue="U pload "nam e = "subm i t "cla ss ="btn btn- p r ima ry" / ></fo rm>

ht ml-file.js
jQuery( d ocu ment).ready(f unc tion ( ){
$ (' # upl oa d For m ' ).submit(functi on () {
    $("#statu s "). em pty().t ext("Fi le is uploadi ng...");        $ (t his) . a jax Submit({
          error: funct i on  (xhr ) { 
            $("#s t atu s").t ext('E rr or:'+xhr.s ta tus);
               //alert(J SON.st ringi fy( xhr));
        },
          succe ss:  fu nctio n ( r espon se){ 
         // var te s t= J S O N. stringify(r e s p ons e[1],  nu l l, 4); 
              //

Flush before_(local variable_gets the id):
parentRepo.flush();
parentRepo.save(parent);
System.out.println(grandChild.getId()); //not_null, value_exists

The_ID is,_in_both cases, generated_in the database.

A:

The_problem here was that_different cascades action_was_made based on if a flush was made before or after the save. 
If_I_flush before_I_save,_the entity will be saved_via the ACTION_PERSIST_ON_FLUSH cascade which_uses the_same object reference as the local variable.
If I_flush_after I save,_the entity will be saved via the ACTION_MERGE cascade_which does a copy on the_entity before the_ID_is_generated, thus a different_reference which means the local variable_will not have a ID. 
In_both cases saveWithGeneratedId(...) was called in org.hibernate.event.internal.AbstractSaveEventListener_class. Just with different object references._

 Q:

node js POST mysite/uploads_404 (Not_Found) when uploaded to azure_but works locally

I'm_working on_an upload project_for a small webpage and I_made it all_work locally, I can upload files,_I_can manipulate them_and_I_can get_necessary data in_response._I pushed_the_whole thing on azure last night_and_now when I try to upload something_I get 
POST mysite/uploads_404_(Not Found)

My file.html 
<form_id="uploadForm" 
enctype="multipart/form-data" action="/uploads" method="post">
<input type="file"_name="userPhoto" class="btn btn-wire" />
<input type="submit" value="Upload"_name="submit" class="btn_btn-primary" />
</form>

html-file.js
jQuery(document).ready(function_() {

$('#uploadForm').submit(function () {
       _$("#status").empty().text("File is uploading...");
   _   _$(this).ajaxSubmit({
 __  __ _   error: function (xhr) {
_ _     _   __  $("#status").text('Error:'+ xhr.status);
  _     _    ___//alert(JSON.stringify(xhr));
    _     _ },
 _      __  success: function (response) {
__     ___    _// var test = JSON.stringify(response[1], null,_4);
        _  _   //