Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6548765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:00:35+00:00 2026-05-25T12:00:35+00:00

I have two tables that exist in the same Oracle database system but different

  • 0

I have two tables that exist in the same Oracle database system but different schemas, which I’ve mapped like this:

ABC.Store:
component schema="ABC" table="Stores"
{
    property name="Id" fieldtype="id" generator="sequence" sequence="store_id_seq";
    property name="Products" fieldtype="one-to-many" cfc="Product";
}

DEF.Product:
component schema="DEF" table="Products"
{
    property name="Id" fieldtype="id" generator="sequence" sequence="product_id_seq";
}

I set my application’s default datasource as this.datasource = "ABC" in application.cfc.

The problem I’m running into here is whenever I try to save a Product. ColdFusion spits out an error that says the sequence cannot be found for the Id property on Product. This is because the product_id_seq sequence is in the DEF schema, but ColdFusion is trying to find it in the ABC schema, even though I set the schema on the Product as DEF.

If I set the datasource attribute on Product to DEF, I then get an error that says the Products property on Store is unmapped. This is because, as the ColdFusion documentation states:

“Since a Hibernate configuration uses a single data source, all related CFCs (using ORM relationships) must have the same data source.”

My question then is, how do I map the two tables in two different schemas, using a sequence as an ID generator?

I’ve been able to get it to work if I specify the schema for the sequence:

property name="Id" fieldtype="id" generator="sequence" sequence="def.product_id_seq";

But this is hard-coded and I’d like it to be dynamic and pull the schema name from a configuration bean.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:00:36+00:00Added an answer on May 25, 2026 at 12:00 pm

    The only way I’ve been able to get this to work seamlessly was to:

    1. Create a single user in database, in this case MySQL, that had access to the desired schemas.
    2. Setup and configure a single datasource in CFIDE that utilizes the newly created user for authentication.
    3. Set the datasource attribute in all desired persistent objects to the newly created datasource.
    4. Set the schema attribute in all desired persistent objects to reference the correct schema, or database. (the two are synonymous in ColdFusion ORM)

    Note: Be sure to use full component path when referencing CFCs in your COM.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a LINQ-to-SQL data context in which two tables exist with different names
Let's say I have two tables that look like this: TH TH TH TH
I have two tables which have the exact same structure. Both tables can store
I have two tables that are joined together. A has many B Normally you
I have two tables that should be joined together by a foreign key relationship,
I have two tables that are considered a single entity in my domain model.
I have two tables that I am joining with the following query... select *
I have two tables that are related via a mapping table: keywords titles I
Suppose I have two tables that are linked (one has a foreign key to
If i have two tables that have nothing in common I want to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.