Mark Espinoza

Apache Tapestry 5, Java, Hibernate, PostgreSQL, Maven, Apache Ant, Apache Tomcat, VPS, HTML, CSS, JQuery, GIT, Parsing, Data Analysis.

Photos
  • 2017.12.16 AD at 10:35 EST
    Mark Espinoza

    Hibernate mappings (part 1)

    Some hibernate mappings on a Postgres database as they have worked for me. I'll explain the options and the parent/child relationships in a later post. (edited: needed to escape the < and >)
    /* One to One *************************/
    /* Parent Blogger */
    @OneToOne(cascade= CascadeType.ALL)
    @JoinColumn(name = "blogger_stats_id")
    private BloggerStats bloggerStats;

    /* Child BloggerStats */
    @OneToOne(mappedBy = "bloggerStats")
    private Blogger blogger;

    /* One to Many ************************/
    /* Parent/child relationship is switched */
    /* Parent BloggerDocument */
    @ManyToOne(optional = false)
    @JoinColumn(name = "blogger_id")
    private Blogger blogger;

    /* Child Blogger */
    @OneToMany(mappedBy="blogger", cascade=CascadeType.ALL)
    private Set<BloggerDocument> bloggerDocuments = new HashSet<>();

    /* Many to Many ***********************/
    /* Parent Blogger */ @ManyToMany
    @JoinTable(name="blogger_join_blogger_group",
    joinColumns={@JoinColumn(name="blogger_group_id")},
    inverseJoinColumns={@JoinColumn(name="blogger_id")})
    private Set<BloggerGroup> bloggerGroups = new HashSet();

    /* Child BloggerGroup*/
    @ManyToMany(mappedBy="bloggerGroups")
    private Set<Blogger> bloggers = new HashSet ();

    #onetomany   #onetoone   #hibernate   #manytomany  
  • 2017.12.09 AD at 11:38 EST
    Mark Espinoza

    What? Snow? Here?

    Forecast was for snow the first night. It snowed, then more in the morning so time to get the kids out and take advantage of it. Hope we get more, hope there's not any ice.

    #snowbeer   #snow   #snowman  
  • 2017.12.04 AD at 21:49 EST
    Mark Espinoza

    Get image dimensions from UploadedFile

    So got rid of width and height requirements when uploading images for posts. Turns out I did not realize I could use ImageIO to get that information where before I had to remember that sometimes I turn my phone sideways or that I took the picture with my camera instead. Anyway hope this helps somebody. The relevant code in the method 'onSuccessFromAddImageForm' has the tags as /* here */

    #uploadedfile   #image   #java   #tapestry5  
  • 2017.12.03 AD at 21:42 EST
    Mark Espinoza

    Midtown street

    Midtown Atlanta by Georgia Tech.

    #midtown   #georgiatech   #fall  
  • 2017.12.03 AD at 21:02 EST
    Mark Espinoza

    Savannah trip with the fam

    You guys need to make it for Christmas.

    #savannah   #family   #goodtimes  
  • 2017.12.03 AD at 20:54 EST
    Mark Espinoza

    Remembering snowmageddon

    As Conan O'Brien put it, 'sometimes two inches is all you need!'

    #snow   #snomageddon   #atlanta   #twoinchesisallyouneed   #snowcapolypse  
  • 2017.12.03 AD at 20:45 EST
    Mark Espinoza

    I'm going back to Cali...

    Trip to California. Got that song stuck in head.

    #sunrise   #windmill   #yuma   #california   #desert  
  • 2017.12.03 AD at 20:34 EST
    Mark Espinoza

    Morning drive

    My morning drive Monday through Friday when I was working at Fort Huachuca. The Tucson desert is the most beautiful in the world, period.

    #desert   #sunrise   #forthuachuca  
  • 2017.12.03 AD at 20:28 EST
    Mark Espinoza

    Sunrose and spilt blood

    Desert sunrise at the Army base outside of Yuma AZ. Can't beat the morning sunrise there, nothing in the way. Oh yeah, this also reminds me of - 'blood has been spilt this night' -from LOTR

    #bloodhasbeenspiltthisnight   #desert   #sunrise   #ypg   #lotr  
  • 2017.11.28 AD at 11:56 EST
    Mark Espinoza

    Midtown Atlanta GA

    Just some black and white in Midtown ATL GA.

    #bw   #midtown  
  • 2017.11.26 AD at 19:35 EST
    Mark Espinoza

    LED Tree

    It folds up, comes with LED lights and no needles to clean up, yeah we be taking this one. The lights come in colors and warm too.

    #t1000tree   #foldingledtree   #xmas  
  • 2017.11.22 AD at 15:02 EST
    Mark Espinoza

    Turkey Time

    Just deep frying some turkey. Got the fryer, turkey, beer, dog and tactical fryer gauge.

    #turkey   #deepfriedturkey   #fall   #tacticalfryergauge   #xmasbeer  
  • 2017.11.20 AD at 08:19 EST
    Mark Espinoza

    Old Fall

    Some older fall photos, plus chance to test the image grid that displays them.

    #imagegrid   #fall   #dev  
  • 2017.11.19 AD at 14:08 EST
    Mark Espinoza

    Reminder to Add HashTag Links

    Reminding myself to add hash tag links on the side that point to a list of relevant posts.

    #hashtags   #reminder   #dev   #tapestry5  
  • 2017.11.19 AD at 12:49 EST
    Mark Espinoza

    New Feature - Login, continued from last post

    So figured out how to handle logins for this site. Basically, I want to stay session free as long as possible. I login and create a session state object. It's automagically available to all pages as long as I inject it. New login service too, with it's own template (a bootstrap modal). Update to the session timeout.

    #newfeature   #dev   #tapestry5   #login  
  • 2017.11.19 AD at 11:29 EST
    Mark Espinoza

    New Feature (new to me)

    So just added the the ability to post from anywhere by providing a secure login, upload capability, with pics, hash tags etc.. I can select from pictures I just added or from all pictures to create a post. I wanted something where I didn't have to use the pictures I just added in a post. So I'm taking pictures and I don't know what I'm going to write, I log back in later and pick which pics I want to use in my new post. The pics are saved as byte arrays in PostgreSQL with the help of a few lines of code to do the conversion(file => input stream => byte array). Now I just have to worry about server space :(

    #newfeature   #tapestry5   #dev  
  • 2017.11.18 AD at 10:09 EST
    Mark Espinoza

    New supplement - Brain Force

    Better than caffeine but only provable after you get off the caffeine for a couple months. Just got off myself and took some nascent iodine to help flush my system. I feel so much better, with no cloudiness in my thinking. The brain force is not daily, maybe weekly as it is more expensive than coffee but cheaper than a daily Starbucks(caramel mocchiato) even on daily basis. It's good for a long, all day coding session or when you know you have to figure something out but don't want to drink a gallon of coffee. Personally since I just got off the caffeine I limit myself to use it when I want a small boost but no edge. It's more of a supplement high to the likes of taking B-12 and amino-acids with fruit before a workout - and maybe after. Good stuff.

    #supplement   #infowars   #caffeine   #brainforce  
blog Index