Actually.. it is...
It will give you a little extra work, but at the end will function correctly...
I would do this...
1 - Create a table called 'category' and would make it exactly clone of com_category table (Joomla's default category)
2 - Create the component as you normally would... with all the foreign keys, connecting categories to items and vice-versa.
3 - Once you are satisfied creating the component, build by normal process and install it to your Joomla.
4 - Go to the models and just rename the category table, so instead to save to your Component category, if would save to the Joomla's com_category table... example
The original Query on model would be something like this
function _buildQuery_ticket()
{
$query = 'SELECT a.*'
. ' , _category_.title AS `_category_title`'
. $this->_buildQuerySelect()
. ' FROM `#__compname_item` AS a'
. ' LEFT JOIN `#__compname_categories` AS _category_ ON _category_.id = a.category_id'
. $this->_buildQueryJoin()
. $this->_buildQueryWhere()
. '';
return $query;
}
So, you have to change for something like this
function _buildQuery_ticket()
{
$query = 'SELECT a.*'
. ' , _category_.title AS `_category_title`'
. $this->_buildQuerySelect()
. ' FROM `#__compname_item` AS a'
. ' LEFT JOIN `#__categories` AS _category_ ON _category_.id = a.category_id'
. $this->_buildQueryJoin()
. $this->_buildQueryWhere()
. '';
return $query;
}
Pay attention that the change was very small... I just renamed the LEFT JOIN `#__compname_categories` to `#__categories`... by this way, I stoped to use the component's categories table, to use Joomla's default categories table.
Hope you get the idea...
PS: Just remember that categories table, may be instantiated in another files on component, such as table folder, controllers and view... Simply rename as I suggested and everything will work fine... After you renamed all, you can drop the table you created and let the component use the default Joomla's table