[transfer-dev] Oracle timestamp field
Hi! I'm using the last version of transfer (today), with coldbox (2.6.3), and with an Oracle 10g database. I use several tables that have a Modified TIMESTAMP field. This field gets updated with the current timestamp everytime a record is modified using a trigger in the database. The problem is that my model uses a Date field, and when a record is instantiated to the java object, I get a jdbc error saying the following: coldfusion.runtime.Cast$DateConversionException: The value class oracle.sql.TIMESTAMP could not be converted to a date. Any suggestions? TIA, Pedro. --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] Re: Oracle timestamp field
Hi Mark, Thanks for your feedback. The Modified TIMESTAMP field is just a field of type TIMESTAMP, similar to a date field, that gets updated with the current time when the record is updated. I needed two fields DateCreated and DateModified than would store the creation and modification dates for every record. I've finally solved the issue using DATE fields, that also store the time, and don't have problems when cast to java Date objects. If anyone is interested, I'll post both triggers that insert the correct dates in both fields. Thanks for the help, Pedro. On May 9, 12:11 am, Mark Mandel mark.man...@gmail.com wrote: Pedro, what is a Modified TIMESTAMP field. ? If it's updated with a trigger, you probably want to use ignore-insert, and ignore-update, and then do a refresh-insert, and refresh-update, to update the value. Have a look at the property documentation here:http://docs.transfer-orm.com/wiki/Transfer_Configuration_File.cfm#pro... Mark On Sat, May 9, 2009 at 2:45 AM, pedrobl pe...@bezunartea.net wrote: Hi! I'm using the last version of transfer (today), with coldbox (2.6.3), and with an Oracle 10g database. I use several tables that have a Modified TIMESTAMP field. This field gets updated with the current timestamp everytime a record is modified using a trigger in the database. The problem is that my model uses a Date field, and when a record is instantiated to the java object, I get a jdbc error saying the following: coldfusion.runtime.Cast$DateConversionException: The value class oracle.sql.TIMESTAMP could not be converted to a date. Any suggestions? TIA, Pedro. -- E: mark.man...@gmail.com W:www.compoundtheory.com --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] Re: manytoone relationships in lists
Could you please give me a few samples? How can I use TQL in the model classes? I checked the examples in coldbox and transfer, but none helped. Thanks, Pedro. On May 28, 7:51 pm, Chris Peterson overrid...@gmail.com wrote: If you added the method in the decorator, but its saying the method does not exist, be sure you are reloading / recreating your transfer factory, and as a last resort be sure to delete all the auto-generated transfer files. Sounds like its not being re-created, because you are on the right track there with the decorator method. Chris Peterson On 5/28/09 1:30 PM, pedrobl pe...@bezunartea.net wrote: This surely has been asked before but, unfortunately I can't find it... I'm developing an application with coldbox, spring and transfer. All in their current latest versions. The data model is: table of Users, and a table of Orders. A user can have many orders. So the Orders table has a userId foreign key that relates it to the Users table. The transfer.xml configuration file is something like: package name=sp object name=User table=users decorator=model.decorators.User id name=userId column=usr_id type=numeric generate=false / property name=Username type=string nullable=false column=usr_username / /object object name=Order table=orders decorator=nw.model.decorators.Order id name=OrderId column=ord_id type=numeric generate=false / property name=Name type=string nullable=false column=ord_name / property name=UserId type=numeric nullable=false column=ord_user_id / manytoone name=OrdUser link column=ord_user_id to=sp.User / /manytoone /object /package And what I'd like to do is, when I get the list of orders using getTransfer().list(sp.Order), I'd like to show the Username of the user related to each Order. What is the easiest way to accomplish this, please? I've tried creating a getOrdUser method in the Order decorator, and trying to call it from the view order.getOrdUser().getUsername(), but this returns an error stating that the method getOrdUser() doesn't exist... Thanks in advance for your help! Pedro. --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] Re: manytoone relationships in lists
Thanks to all for the answers. I have a couple of basic questions though... In the FAQs, in the question on the differences of oneToMany and ManyToOne relationships, it says that the objects in both sides of the relation are visible to each other. My problem is that when generating a LIST of objects (Orders) with a ManyToOne relationship (with Users), I cannot access any information on the ToOne part of the relationship. i.e. When I get a list of Orders, I cannot access any info of the related User objects... Is this correct? Is this the way it's supposed to work? I guess what I need to do is: in the method called to get the list (dspOrders), use a TQL to retrieve the fields I need using the transfer.ListByQuery method... right? Thanks again for your help, Pedro. On May 29, 3:06 pm, Mark Mandel mark.man...@gmail.com wrote: You have direct access to Transfer from within the Decorator: http://docs.transfer-orm.com/wiki/Writing_Decorators.cfm#Access_to_Tr... Mark On Fri, May 29, 2009 at 8:28 PM, pedrobl pe...@bezunartea.net wrote: Could you please give me a few samples? How can I use TQL in the model classes? I checked the examples in coldbox and transfer, but none helped. Thanks, Pedro. On May 28, 7:51 pm, Chris Peterson overrid...@gmail.com wrote: If you added the method in the decorator, but its saying the method does not exist, be sure you are reloading / recreating your transfer factory, and as a last resort be sure to delete all the auto-generated transfer files. Sounds like its not being re-created, because you are on the right track there with the decorator method. Chris Peterson On 5/28/09 1:30 PM, pedrobl pe...@bezunartea.net wrote: This surely has been asked before but, unfortunately I can't find it... I'm developing an application with coldbox, spring and transfer. All in their current latest versions. The data model is: table of Users, and a table of Orders. A user can have many orders. So the Orders table has a userId foreign key that relates it to the Users table. The transfer.xml configuration file is something like: package name=sp object name=User table=users decorator=model.decorators.User id name=userId column=usr_id type=numeric generate=false / property name=Username type=string nullable=false column=usr_username / /object object name=Order table=orders decorator=nw.model.decorators.Order id name=OrderId column=ord_id type=numeric generate=false / property name=Name type=string nullable=false column=ord_name / property name=UserId type=numeric nullable=false column=ord_user_id / manytoone name=OrdUser link column=ord_user_id to=sp.User / /manytoone /object /package And what I'd like to do is, when I get the list of orders using getTransfer().list(sp.Order), I'd like to show the Username of the user related to each Order. What is the easiest way to accomplish this, please? I've tried creating a getOrdUser method in the Order decorator, and trying to call it from the view order.getOrdUser().getUsername(), but this returns an error stating that the method getOrdUser() doesn't exist... Thanks in advance for your help! Pedro. -- E: mark.man...@gmail.com W:www.compoundtheory.com --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] SOLVED: manytoone relationships in lists
Thanks again to everyone. I leave my last questions opened, but I solved the issue, and learnt a little more about transfer :P I solved it by using the transfer.listByQuery method instead of the default transfer.list. Taking the objects described before, this is the code: ... cfset var myQuery = getTransfer().createQuery(from sp.Order join sp.User) / cfset var orders = getTransfer().listByQuery(myQuery) / ... And then, in the view I have all properties from the Order (Name) and the User (Username) objects. Thanks all for the rapid response, and the good tips! CU! Pedro. --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] Filter null values
Hi! I'm using transfer current version and colbox, and I'd like to use the listByPropertyMap method to filter by null values. Can this be done not using TQL? TIA, Pedro. --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] Order case sensitivity
Hi! I'm using transfer with Oracle as the data backend, and I've come across an annoying problem when sorting. I have a few text fields defined in a table, and I'd like to sort by those fields but with case in-sensitivity. An example: Current order: MARS ATTACKS MORE DATA Mars attacks man on the moon Desired order: man on the moon MARS ATTACKS Mars attacks MORE DATA Usually this is accomplished by issuing an ORDER BY LOWER(title) in SQL, but that's not available in TQL Any ideas, recommendations. I can solve this by adding a view, but it'd be perfect if transfer has something available on this. TIA, Pedro. --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] Re: Order case sensitivity
Thanks Mark! I was thinking on using views, but I'd have to duplicate the text fields I want to sort by, with a small case version... :( Oh, well, Thanks for your great software! Pedro. On Aug 12, 11:49 pm, Mark Mandel mark.man...@gmail.com wrote: Eeep! Sounds like you are going to have to use some regular SQL for that one. Mark On Thu, Aug 13, 2009 at 12:20 AM, pedrobl pe...@bezunartea.net wrote: Hi! I'm using transfer with Oracle as the data backend, and I've come across an annoying problem when sorting. I have a few text fields defined in a table, and I'd like to sort by those fields but with case in-sensitivity. An example: Current order: MARS ATTACKS MORE DATA Mars attacks man on the moon Desired order: man on the moon MARS ATTACKS Mars attacks MORE DATA Usually this is accomplished by issuing an ORDER BY LOWER(title) in SQL, but that's not available in TQL Any ideas, recommendations. I can solve this by adding a view, but it'd be perfect if transfer has something available on this. TIA, Pedro. -- E: mark.man...@gmail.com T:http://www.twitter.com/neurotic W:www.compoundtheory.com --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] Re: manytomany... not quite
Hi Matt! Thanks for the response... On Sep 3, 3:07 am, Matt Quackenbush quackfu...@gmail.com wrote: Can you post the relevant transfer.xml configs? I could be mistaken, but I think the issue is that you have an o2m on one side and an m2o on the other. AFAIK, that will not do the trick. Why not? what is the problem, and how can I solve it? Here is the relevant section of my transfer.xml: package name=dc object name=Person table=Persons id name=PersonId type=string generate=false column=PERSON_ID / property name=Name type=string nullable=false column=FIRST_NAME / ... onetomany name=PersonOrg lazy=true link to=dc.PersOrg column=PERSON_ID / collection type=array /collection /onetomany onetomany name=PersonProj lazy=true link to=dc.PersonProj column=PERSON_ID / collection type=array /collection /onetomany /object ... Org and Project definitions are similar to Person's. object name=PersonOrg table=PersonOrg id name=PersOrgId type=string generate=false column=PERS_ORG_ID / property name=Role type=string nullable=true column=ROLE / ... manytoone name=Person lazy=true link column=PERSON_ID to=dc.Person / /manytoone manytoone name=Org lazy=true link column=ORG_ID to=dc.Org / /manytoone /object /package --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] Re: manytomany... not quite
I already had all I needed... and a little more. I was actually making the mistake described on this page: http://docs.transfer-orm.com/wiki/Same_foreign_key_for_a_manytoone_and_a_onetomany.cfm So I removed the m2o relation from my relations' objects, the PersonOrg mentioned in previous messages. To show the org info when showing a Person object (org name, acronym, etc), with its list (getPersonOrgArray) of related PersonOrg records (Role), I used the getParentOrg method available at the many end of the o2m relation Org-PersonOrg... works like a charm, and I think it loads faster also! Thanks for pointing me in the right direction... I owe you one ;) Pedro. --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] Re: manytomany... not quite
Hi Matt! Actually, trying to save the object PersonOrg still throws a duplicate column name error :( I thought that it was fixed because I configured a copy of the original object PersonOrgPlain in transfer.xml with no relation to Person or Org, and was saving this kind of object. What works better is the view of the Person page with the list of related Orgs and Projects. I guess there's no way of saving objects that are the end of a o2m relation, because they will always have an extra foreignKeyId field... I'd like to have all the relationship Object's data management within the same configuration, but I can live with duplicating the objects that deal with m2m relations for now... I'd like to find a more elegant solution, from the data model's design and coding perspective though. Any suggestions apart from overwriting the generated methods in the PersonOrg objects? TIA, Pedro. --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] removemanytoone and cascadeDelete
Hi! I'm using transfer 1.1 with an application on Coldbox. Mi model: - Person (name, countryId): many2one with Country, one2Many with PersonOrg. - Org (name, countryId): many2one with Country, one2Many with PersonOrg. - PersonOrg (personId, orgId, role): role can be 'staff', 'contact', 'interested', etc. - Country (name, countryId) The problem: I'd like to be able to delete an organisation, and its relations with persons, but not the persons themselves, and neither the country. i.e. all records from PersonOrg related to the Organisation. If I try cascadeDelete, all objects related to the organisations will be deleted PersonOrg and Country. I read in the documentation about removemanytoone... and I thought it was what I needed! I could remove the link between Country and Organisation before doing the cascadeDelete... right? Transfer responds with The method removemanytooneCountry was not found :( Am I missing something? Do I need to manually delete all related one2many objects? TIA, Pedro. --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] Re: removemanytoone and cascadeDelete
Hi again Matt! Thanks for your response, On Oct 15, 3:32 am, Matt Quackenbush quackfu...@gmail.com wrote: Transfer does not allow you to have two different objects with an o2m like you are describing. Can you please show us the relevant XML from your transfer.xml file? Here's the transfer.xml: package name=dc object name=Person table=DC_PERSONS decorator=dc.model.decorators.Person id name=PersonId column=PERSON_ID type=string generate=false / property name=FirstName type=string nullable=false column=FIRST_NAME/ property name=FamilyName type=string nullable=false column=FAMILY_NAME/ manytoone name=Country lazy=true link column=COUNTRY_CODE to=dc.Country / /manytoone onetomany name=PersonOrg lazy=true link to=dc.PersonRole column=PERSON_ID / collection type=array/collection /onetomany /object object name=Org table=DC_ORGANISATIONS decorator=dc.model.decorators.Org id name=OrgId type=string generate=false column=ORG_ID / property name=CommonName type=string nullable=false column=COMMON_NAME / manytoone name=Country lazy=true link column=COUNTRY_CODE to=dc.Country / /manytoone onetomany name=PersonOrg lazy=true link to=dc.PersonOrg column=ORG_ID / collection type=structkey property=PersonId//collection /onetomany /object object name=Country table=DC_COUNTRIES id name=CountryCode type=string generate=false column=COUNTRY_CODE / property name=CountryName type=string nullable=false column=COUNTRY_NAME / /object object name=PersonOrg table=DC_PERSON_ROLE id name=PersonOrgId column=PERSON_ORG_ID type=string generate=false / property name=PersonId type=string nullable=false column=PERSON_ID / property name=OrgId type=string nullable=true column=ORG_ID / property name=RoleId type=string nullable=false column=ROLE_ID / /object /package Obviously, PersonId and OrgId are foreign keys in PersonOrg. The same person can have different roles in the sale organisation. Pedro. --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] Re: removemanytoone and cascadeDelete
On Oct 15, 5:25 pm, Matt Quackenbush quackfu...@gmail.com wrote: Ok, first of all, just to reiterate, you cannot use an o2m on two objects like that. You will need to use m2o and then add decorator methods to fill in the missing methods that you need. Sorry but I guess this onetomany relation is a little confusing. I have checked some of the coldbox sample applications, as well as codexwiki, and I think I'm beginning to understand... it's taking me a while, I know :P I have a question before I begin re-designing my transfer model. In the docs, more specifically in the FAQ: http://docs.transfer-orm.com/wiki/Should_I_use_ManyToMany,_or_two_OneToMany_compositions.cfm It says: Use two OneToMany compositions with a common child when your child object is a business object with its own state. If the association table holds nothing but the two foreign keys, use ManyToMany. My case is the former, my linking tables have their own state and it's the end of two one2many relationships, from two different objects. If this is not the correct way of having a state-full linking table, which is? Secondly, you will want to call removeCountry() on the object, and not removemanytooneCountry(). Hopefully that will be enough to get you moving forward again. :-) As always, thanks for your help... and for your wiki ;) --~--~-~--~~~---~--~~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~--~~~~--~~--~--~---
[transfer-dev] Modify (move) relationships
Hi! I have an organisation object with two o2m relations person and projects. In order to eliminate duplicates, I need to move the related persons and projects from one organisation to another. Is there an easy way to do this with transfer? I use two linking tables org_person, and org_project to store the relation between them, and also stores other information like the person's role (staff, contact, administrator, etc...), or the initial and end date for the relation. I'd like to move those relationships unchanged, just to move them from organisation A to organisation B. In SQL this would be trivial to do by just updating the organisation FK from organisation A, to organisation B in the org_person table. I'd like to avoid looping through the org_person structure to modify each org_person.OrgId from one organisation to the other, as I'd need to create the organisation objects. Can this be achieved in one shot? Something like: cfset org1persons = org1.getPersonsStruct() / cfset org2persons = org2.getPersonsStruct() / cfset StructAppend(org1persons, org2persons, true) / cfset org1.setPersons(org1persons) / TIA! Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Re: Modify (move) relationships
Sean, Thanks for the reply! Unfortunately, the organisations and persons are not related directly. This is my transfer.xml file: package name=dc object name=Organisation table=organisations id name=OrgId type=string generate=false column=ORG_ID / property name=CommonName type=string nullable=false column=COMMON_NAME / ... onetomany name=OrgPerson lazy=true link to=dc.OrgPerson column=ORG_ID / collection type=struct key property=OrgPersonId/ /collection /onetomany /object object name=Person table=DC_PERSONS id name=PersonId column=PERSON_ID type=string generate=false / property name=FirstName type=string nullable=false column=FIRST_NAME/ property name=FamilyName type=string nullable=false column=FAMILY_NAME/ ... onetomany name=OrgPerson lazy=true link to=dc.OrgPerson column=PERSON_ID / collection type=struct key property=OrgPersonId/ /collection /onetomany /object object name=OrgPerson table=DC_ORG_PERSON id name=OrgPersonId column=ORG_PERSON_ID type=string generate=false / property name=PersonId type=string nullable=false column=PERSON_ID / property name=OrgId type=string nullable=false column=ORG_ID / property name=Role type=string nullable=false column=ROLE / property name=StartDate type=date nullable=true column=START_DATE / property name=EndDate type=date nullable=true column=END_DATE / /object As I need to have many roles per person and organisation, i.e. a many- to-many relation between organisations and persons with extra data in the linking table. I'd like to append the OrgPerson Struct that belongs to Organisation 2, to the Organisation 1 that replaces it. Something like: cfset org1persons = org1.getPersonsStruct() / cfset org2persons = org2.getPersonsStruct() / cfset StructAppend(org1persons, org2persons, true) / cfset org1.setPersonsStruct(org1persons) / I'd like to avoid looping through all org2persons struct members. Is your commendation something like the following? cfloop collection=#org2persons# item=OrgPersonId cfset orgpersons[OrgPersonId].setParentOrganization(org1) / /cfloop TIA, Pedro. On Nov 30, 2:02 pm, Sean Coyne coyne.s...@gmail.com wrote: depends on your Transfer configuration but most likely you would do something like: cfset person.setParentOrganization(org) / where person is your person object and org is your organization object. Note that this will only work if you have specified a one to many in the organization configuration and that you called organizations Organization in your transfer config. Sean On Nov 28, 10:14 pm, pedrobl pe...@bezunartea.net wrote: Hi! I have an organisation object with two o2m relations person and projects. In order to eliminate duplicates, I need to move the related persons and projects from one organisation to another. Is there an easy way to do this with transfer? I use two linking tables org_person, and org_project to store the relation between them, and also stores other information like the person's role (staff, contact, administrator, etc...), or the initial and end date for the relation. I'd like to move those relationships unchanged, just to move them from organisation A to organisation B. In SQL this would be trivial to do by just updating the organisation FK from organisation A, to organisation B in the org_person table. I'd like to avoid looping through the org_person structure to modify each org_person.OrgId from one organisation to the other, as I'd need to create the organisation objects. Can this be achieved in one shot? Something like: cfset org1persons = org1.getPersonsStruct() / cfset org2persons = org2.getPersonsStruct() / cfset StructAppend(org1persons, org2persons, true) / cfset org1.setPersons(org1persons) / TIA! Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Re: empty string is persisted in field where nullable=false
Hi Dennis, thanks for your help. On Aug 17, 11:17 pm, Dennis Clark wrote: Null values in Transfer are covered in the wiki: seehttp://docs.transfer-orm.com/wiki/Handling_Null_Values.cfm I had read the docs, but obviously didn't fully understand the consequences. If you have nullable=true for a property and you set the property to an empty string, the corresponding column will be set to NULL on save. When you read the column back, the property is populated with an empty string. If you have nullable=false for a property and you set the property to an empty string, the corresponding column will be set to an empty string on save. When you read the column back, the property is populated with an empty string. Thanks again, it now makes sense. I had always taken them as some kind of validation... :P If you want to be able store both NULLs and empty strings in the same column... Actually, I want the field NOT to be null. I have already solved the issue just by not validating the object when the field is empty. But I have another problem which I'll post in another thread. Does that make sense? Perfect sense :) Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Dirty read problem
I'm having an issue where a user edits an object that does not get validated, and then another user, in another computer, requests that object's data and receives the invalid data, with the isDirty flag set. It probably has to do with the cache, so just in case this is transfer cache configuration: objectCachedefaultcache scope type=instance / /defaultcache/objectCache And coldbox's (2.6.4) relevant configuration: Setting name=HandlerCaching value=true/ Setting name=EventCachingvalue=true/ Setting name=IOCObjectCachingvalue=true / Setting name=IOCFrameworkvalue=coldspring / TIA, Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Re: Dirty read problem SOLVED
OK, after reading again the documentation on caching, I thought it'd smart to discard the invalid object from the cache. Simple. It's probably in the documentation... but I'm fond of learning by making mistakes... very fond of, apparently, :) Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Re: Dirty read problem SOLVED
Hi! On Aug 18, 2:11 am, Bob Silverberg wrote: An easier solution is to clone() your Transfer object before you populate it. Then the dirty data never gets into the cache. Yeap. More elegant, too. Thanks for the quick response, Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Date precision Postgresql vs. Oracle
Hi there! I have 2 systems for development. Some of the software is the same in both (transfer 1.1, coldbox 2.6.4), but the database server is Oracle 10g in one, and postgresql 8.4 in the other. I'd like the dates to be shown with the time also. I have a transfer.list that shows a date and oddly enough, in the system with oracle the date is printed without the time, on the other system with postgres, the time is displayed by default. How can I make this consistent? Transfer seems to loose information on date fields with oracle. If I TimeFormat() the dates from oracle, I get 00:00:00 although the raw data in oracle contains the information needed. Any ideas? TIA, Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Re: Date precision Postgresql vs. Oracle
Hi Mark! On Aug 27, 1:29 am, Mark Mandel wrote: So this is just on retrieval, and just on list operations? On both. I've just tested it. I'm trying to display what comes from the list (myTimeStamp), or from the get() entry using: DateFormat(myTimeStamp,/MM/DD) TimeFormat(TimeStamp, HH:mm:ss) And this is what it returns on both cases: 2010/08/27 00:00:00 What driver are you using? The Adobe CF one? Of course! Sorry I didn't post it before: CFMX version: 7.0.1.116466 JDBC Macromedia oracle driver version: 3.50 Mark Thanks a lot Mark... for the help, and for transfer :) Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Re: Date precision Postgresql vs. Oracle
Oops! I meant: DateFormat(myTimeStamp,/MM/DD) TimeFormat(myTimeStamp, HH:mm:ss) Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Re: Date precision Postgresql vs. Oracle
And also, the version for the coldfusion/drivers/ojdbc14.jar, from its MANIFEST file: Specification-Title:Oracle JDBC driver classes for use with JDK14 Created-By: 1.4.2_08 (Sun Microsystems Inc.) Implementation-Title: ojdbc14.jar Specification-Vendor: Oracle Corporation Specification-Version: Oracle JDBC Driver version - 10.2.0.1.0 Implementation-Version: Oracle JDBC Driver version - 10.2.0.1.0 Implementation-Vendor: Oracle Corporation Implementation-Time:Wed Jun 22 18:55:48 2005 I thought this may be relevant information. Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Re: Date precision Postgresql vs. Oracle
Your question on jdbc Driver version was on the right track. I found a known problem with the jdbc drivers provided by adobe. Interesting discussion: http://www.justskins.com/forums/cfmx-and-oracle-10g-128214.html I'll see if I can convince IT to modify Coldfusion's bootup options. Another solution they point out in the discussion is to replace all date fields with timestamp fields, but I seem to remember transfer does not support timestamp. I'll test a couple of things and post the results, Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Re: Date precision Postgresql vs. Oracle
I installed CF7 on the machine I have postgres, and it works just fine, it shows the date and time correctly. The problem is then with the oracle jdbc driver in coldfusion. I have also tried to change the field to timestamp in oracle. This provokes a JAVACast exception that I'll try to check on monday... Thanks again Mark, Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] No records returned: CF7 and oracle
Happy new year everyone! I left last year with a strange problem that probably has an easy solution which I fail to see. I'm using Coldbox, Coldspring, Transfer and Oracle 10g. I have stumbled upon a few driver issues, and this probably has something to do with it. First, the table: sessions, which just has the following fields: PersonId (CHAR 32), Token (CHAR 36). The use case is simple, a user wants to be authenticated and doesn't remember her password. She accesses a form where she enters her email address, the system checks that the email exists, generates a token using CreateUUID(), persists the session object to the database, and sends an email with a link containing the token just created. The link takes the user to a page where all the system has to do is search the database for the token, and generate a user session accordingly... pretty simple. Second, transfer.xml: object name=Session table=USER_SESSIONS id name=PersonId column=PERSON_ID type=string generate=false / property name=SessionToken type=string nullable=false column=TOKEN / /object Amazingly, the record is never found. I have tried many transfer methods, all unsuccessfully, among others: - readByProperty: SessionToken, and the generated token. - readByPropertyMap: the map consists of a struct with a SessionToken key, and the token as its value. - listByQuery: the query is simple FROM ...Session WHERE ...Session.SessionToken=:sessionToken - Change the TOKEN field to varchar2. The first two return a new object, and the third returns an empty query. I also cfdump the whole table, to check that the record exists, and the sql sent to oracle, and all look just fine... as they do in many other parts of the application. If I run the query generated directly in SQLDeveloper, it works fine. I have also tried the same code using postgresql instead of Oracle, and it works!! Sorry for the long post. What else could I try to debug this? Any ideas? TIA, Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Re: No records returned: CF7 and oracle
This is getting weirder and weirder. I modified the table and transfer config changing the field name to session_token, instead of token. No luck, same results. I then tried to see the sql being sent to oracle when using listByProperty, and readByProperty. To do this I modified transfer configuration to point to the wrong table and provoke a table or view does not exist error that shows the sql that failed. - For the readByProperty method, the query is: select PERSON_ID from NW_SESSIONS where SESSION_TOKEN = (param 1) - For the listByProperty method, the query is: select SESSION_TOKEN as SessionToken, PERSON_ID as PersonId from NW_SESSIONS where SESSION_TOKEN = (param 1) The param 1 in both cases is just fine: (param 1) = [type='IN', class='java.lang.String', value='4B85F89A-D1AF- E4E2-13148E6984C1271F', sqltype='cf_sql_varchar'] If I run both queries directly, they both work as expected, both return 1 row, on the other hand if transfer runs them, they return no rows... WTF? I am at a loss here, I don't know what else to try. This doesn't make any sense!! Pedro. On Jan 4, 12:30 pm, pedrobl pe...@bezunartea.net wrote: On Jan 4, 12:18 pm, Mark Mandel mark.man...@gmail.com wrote: So that doesn't make sense... If the sql debug says that nothing is returned, but it returns values when you copy and paste it into a sql editor? Is that right? Exactly, it does not make sense. I do similar things all over the application. I don't understand why this is not working... I'm changing the field name TOKEN to SESSION_TOKEN, maybe that has something to do with it. I'll post the results in a minute. Thanks for your patience, Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Re: No records returned: CF7 and oracle SOLVED
I found it!!! The problem was that the token field was defined as CHAR 36, and the token generated was 35 characters long. The token was being stored with an space at the end. What I still don't understand is why when transfer runs the query select PERSON_ID from NW_SESSIONS where SESSION_TOKEN = (param 1), and param1 is 35 characters long, it returns no rows, but when I run the query directly in SQL Developer select PERSON_ID from NW_SESSIONS where SESSION_TOKEN = '4B85F89A-D1AF-E4E2-13148E6984C1271F';, it returns one row... Oh well!, thank you Mark, and sorry for wasting your valuable time, Pedro -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Re: Non case sensitive searches
Oops! I should've checked previous posts carefully. I saw that you have a feature request in that sense... Can I help? I'd really like to see this implemented. Pedro. On Apr 21, 2:03 am, pedrobl pe...@lopezredondo.net wrote: Hi all, First thing, the system: Coldfusion MX7, Oracle 10g, transfer 1.1. I need searches not to be case sensitive. I've tried to walk around this issue with different approaches, but each had its problems: - Changing the NLS settings in oracle. The problem: the data model needs too many extra indices. Also, it turns out that setting the session parameters to oracle's jdbc connection can have unexpected results. - Creating views in oracle with extra lower(columns) and extra properties in their respective transfer objects. The problem: the data model gets messy soon. I thought that it may be easier using transfer to solve the issue. The idea is that, when translating from TQL to SQL using the LIKE function, the column could be translated to 'LOWER(column_name)', instead of just 'column_name', and searching for lcase('%query%'), instead of just '%query%'. I've had a look at transfer's source code, as well as ANTLR and a hint as to where to look would be greatly appreciated... or any other ideas for that matter. Could I modify conditionBasicClause and the like OPERATOR in the Tql.g file? I guess I probably should modify the SQL part, not the TQL part... Thanks in advance, Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Re: Transfer/MySQL saving 0 as NULL in int field
Hi Brian, What you need to do is to set an integer value that represents the null value in coldfusion. You can do this by setting the nullvalue attribute in your property. In your case: property name=milliseconds type=numeric nullable=true nullvalue=- / This tells transfer that it should insert a null value in the database if and only if the property's value is -. The default nullvalue for integers is 0, and that's why transfer inserts a null in the database when you have 0 milliseconds. You need to have nullable set to true in order for nullvalue to have any effect. Does you milliseconds property need to have nulls? You may be interested in the following documentation also: http://docs.transfer-orm.com/wiki/Default_Property_Values.cfm http://docs.transfer-orm.com/wiki/Custom_Methods.cfm HTH, Pedro. On Aug 4, 9:37 pm, Brian FitzGerald bmfitzgera...@gmail.com wrote: Hey Jason, Thanks a lot for chiming in. Unfortunately after setting nullable to false on that property in the transfer config, it still inserts NULL. This is what my config node looks like: object name=CourseScript table=courseScript decorator=model.businessObjects.CourseScriptDecorator id name=courseScriptId type=numeric / property name=courseId type=numeric / property name=scriptId type=numeric / property name=milliseconds type=numeric nullable=false / /object Any other thoughts? Thanks, Brian -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
[transfer-dev] Non case sensitive searches, revisited
Last April I offered my time to solve this issue but, unfortunately didn't receive any responses. The time has come for me to solve this issue once and for all. I'd really appreciate any feedback. The problem: Transfer does not support functions, so it's not possible to do non case sensitive searches using functions like LCASE. Initially I solved the issue by creating views in the DB server with a LCASE version of the columns I needed to search, and adding new objects in Transfer. The problem of this approach is that it soon gets very messy: you need to have duplicate versions of the same objects in Transfer; you need to create extra views in the DB; if you decide to search in another column, you need add more code; and most important, the DB indices are not used as the query that the server receives does not include LCASE. (If someone needs more details on this, please let me know) The proposed solution: Ideally, I'd like to add support for SQL functions to Transfer, but I'm afraid it's too big of a problem for me. The second, simpler option is to modify Transfer's behaviour when it deals with the LIKE function. After checking Transfer and ANTLR source code, the easiest path seems to be to modify the TQLSQL translation of the LIKE operator from the current translation: property LIKE expr - column LIKE expr to property LIKE expr - LCASE(column) LIKE LCASE(expr) This way, the DB server knows it should use the LCASE index. Any ideas? comments? TIA, Pedro. -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups transfer-dev group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en