http://coldfusion.com logo
Join Slack
Powered by
# orm
  • d

    dfgrumpy

    01/28/2022, 6:53 AM
    Has anyone seen an issue where ormreload() doesn’t do anything? I have an app running on Lucee 5.3.8.206 and in local dev ormreload is ran on every request. However, any changes to the orm cfcs are not picked up when dbcreate is set to update. If I change it dropcreate the tables are rebuilt. Anyone have any ideas? TIA.
    r
    • 2
    • 9
  • d

    deactivateduser

    03/22/2022, 3:04 PM
    Ok so it has been a while since I have been deep in orm session mumbo jumbo, for context this is adobe 2018. I would like some confirmation to make sure my memory is not causing me to have issues. But if I am using 2 datasources in my system. 1 that uses ORM and 1 that doesn't. If I have some objects being loaded in via orm with datasource 1, and then I run a transaction against datasource 2, does that close the session in datasource 1? Going to explain the code in the thread for more detail.
    r
    g
    • 3
    • 25
  • g

    Gregory Alexander

    01/05/2023, 9:54 AM
    Is there a good article on how to covert ACF ORM to Lucee? I want to port Galaxie Blog over to Lucee and am not quite sure where to begin.
    c
    s
    +2
    • 5
    • 10
  • t

    Tomy Saman

    05/25/2023, 12:49 AM
    @Tomy Saman has left the channel
  • d

    daniel

    07/17/2023, 12:37 PM
    @daniel has left the channel
  • d

    dfgrumpy

    11/01/2023, 2:46 PM
    I am running into a weird issue and I am hoping someone has an idea as to what is going on. I am working on a project using a Lucee and a postgres database . In the orm cfcs all of the ID columns are set to use a generator of sequence and each one is assigned to use a specific sequence. In development this works great. However, in production it doesn't work. In production the declared sequence is ignored and all tables are using a sequence of "hibernate_sequence" Anyone have any idea as to what would be causing this?
    q
    j
    • 3
    • 4
  • g

    Gregory Alexander

    05/27/2024, 8:09 PM
    I am venturing down the Lucee ORM rabbit hole using the Lucee ORM extension from Ortus and am having problems. Furthermore, I can't find the error with a Google search, which is odd. When trying to save a blog record, I get the following error that points to the EntitySave: *Lucee 5.4.4.38 Error (expression)Message*Can't cast String [1] to a value of type [Component] This is my code: <!--- Save the records into the table. ---> <cftransaction> <cfif arrayLen(getData) eq 0> <cfset BlogDbObj = EntityNew("Blog")> <cfelse> <cfset BlogDbObj = EntityLoadByPk("Blog", getData[1])> </cfif> <cfdump var="#BlogDbObj#"> <!--- Set blog meta data ---> <cfoutput query="Data" maxrows="1"> <!--- Make the name unique. ---> <cfset BlogDbObj.setBlogName('GalaxieBlog3_' & BlogDbObj.getBlogId())> <cfset BlogDbObj.setBlogTitle(thisBlogTitle)> <!--- Date ---> <cfset BlogDbObj.setDate(now())> <!--- Save it ---> <cfset EntitySave(BlogDbObj)> </cfoutput> </cftransaction>
    s
    l
    • 3
    • 7
  • g

    Gregory Alexander

    05/27/2024, 8:15 PM
    Thanks for the reply, I thought along the same lines and tried that and still get the error: <cftransaction> <cfif arrayLen(getData) eq 0> <cfset BlogDbObj = EntityNew("Blog")> <cfelse> <cfset BlogDbObj = EntityLoadByPk("Blog", getData[1])> </cfif> <cfdump var="#BlogDbObj#"> <!--- Set blog meta data ---> <cfoutput query="Data" maxrows="1"> <!--- Save it ---> <cfset EntitySave(BlogDbObj)> </cfoutput> </cftransaction> The Error Occurred in D\wwwroot\commandbox jre win64 6.0.0\galaxie\installer\insertData.cfm line 69
    67: <cfoutput query="Data" maxrows="1">
    68: <!--- Save it --->
    69: <cfset EntitySave(BlogDbObj)>
    70: </cfoutput>
    71:
    l
    • 2
    • 3
  • r

    Rodney

    05/29/2024, 5:17 PM
    @Rodney has left the channel
  • g

    Gregory Alexander

    06/03/2024, 3:53 AM
    I tried for a long time to figure this out, but I need help figuring it out. I updated and downgraded the MySql database, Ortus ORM extension, and Hibernate, started over, and used a new schema, add rinse and repeat- however, ORM is still randomly creating certain columns and tables from the persistent CFCs. Are there any tricks to getting ORM to create all of the database tables and columns from a persistent CFC? I Have around 40 different tables, and the column definitions are identical, other than the names, yet ORM is still adding certain columns and tables, and missing others. For example, ORM successfully creates the PostHeader column in the Post table, but does not create the CSS column in the same table, yet the two properties are the same. <cfproperty name="PostHeader" ormtype="text" sqltype="longtext" default=""> <cfproperty name="CSS" ormtype="text" sqltype="longtext" default=""> Orm also misses creating the Tag table, I had thought that this may be a reserved word for MySql (even though it works using ACF), so I changed the table name to Tags and changed Tag to TagName, but this table is never created. I have spend the last two days trying to nail this one down to no avail. Any tricks with Lucee and the Ortus extension?
    g
    l
    +2
    • 5
    • 44
  • g

    Gregory Alexander

    06/03/2024, 4:13 AM
    the ORM settings are defined in the Application.cfc template, after line 56 at https://github.com/GregoryAlexander77/Galaxie-Blog/blob/master/Application.cfc The Tag cfc definitions are at https://github.com/GregoryAlexander77/Galaxie-Blog/blob/master/common/cfc/db/galaxieDb/Tag.cfc All of the other definitions are in the following two folders- the 6 files in the first folder replace the files with the same name in the 2nd folder. https://github.com/GregoryAlexander77/Galaxie-Blog/tree/master/installer/databaseOrmFiles/mySql https://github.com/GregoryAlexander77/Galaxie-Blog/tree/master/common/cfc/db/galaxieDb
  • g

    Gregory Alexander

    07/17/2024, 4:32 AM
    Does anyone have any tricks to force Lucee to read the persistent cfc's to recreate the MySql database? When I make changes to the ORM-related cfc's, the model is not being updated in the database. I have used ormReload() in the Application.cfc in multiple places to no avail- the database never gets updated. I am using dbcreate:="update" and the code has been working with Galaxie Blog ACF for several years (see https://github.com/GregoryAlexander77/Galaxie-Blog/blob/master/Application.cfc). I am almost tempted to create a new database, change the datasource and start over. Any advice would be appreciated.
    g
    l
    r
    • 4
    • 29
  • c

    Chase Lane

    03/06/2025, 2:51 PM
    @Chase Lane has left the channel